本文整理汇总了Python中robottelo.ui.factory.make_syncplan函数的典型用法代码示例。如果您正苦于以下问题:Python make_syncplan函数的具体用法?Python make_syncplan怎么用?Python make_syncplan使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了make_syncplan函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_positive_create_with_start_date
def test_positive_create_with_start_date(self):
"""Create Sync plan with specified start date
:id: 020b3aff-7216-4ad6-b95e-8ffaf68cba20
:expectedresults: Sync Plan is created with the specified date
:BZ: 1460146
:CaseLevel: Integration
"""
plan_name = gen_string('alpha')
with Session(self) as session:
startdate = (self.get_client_datetime(session.browser)
+ timedelta(days=10))
make_syncplan(
session,
org=self.organization.name,
name=plan_name,
description='sync plan create with start date',
startdate=startdate.strftime("%Y-%m-%d"),
)
self.assertIsNotNone(self.syncplan.search(plan_name))
self.syncplan.click(self.syncplan.search(plan_name))
startdate_text = self.syncplan.wait_until_element(
locators['sp.fetch_startdate']).text
self.assertEqual(
str(startdate_text).partition(' ')[0],
startdate.strftime("%Y/%m/%d")
)
示例2: test_negative_synchronize_custom_product_past_sync_date
def test_negative_synchronize_custom_product_past_sync_date(self):
"""Verify product won't get synced immediately after adding association
with a sync plan which has already been started
:id: b56fccb9-8f84-4676-a777-b3c6458c909e
:expectedresults: Repository was not synchronized
:BZ: 1279539
:CaseLevel: System
"""
plan_name = gen_string('alpha')
product = entities.Product(organization=self.organization).create()
repo = entities.Repository(product=product).create()
with Session(self) as session:
startdate = self.get_client_datetime(session.browser)
make_syncplan(
session,
org=self.organization.name,
name=plan_name,
startdate=startdate.strftime('%Y-%m-%d'),
start_hour=startdate.strftime('%H'),
start_minute=startdate.strftime('%M'),
)
self.syncplan.update(
plan_name, add_products=[product.name])
with self.assertRaises(AssertionError):
self.validate_task_status(repo.id, max_tries=2)
self.validate_repo_content(
repo,
['erratum', 'package', 'package_group'],
max_attempts=5,
)
示例3: test_positive_create_with_start_time
def test_positive_create_with_start_time(self):
"""Create Sync plan with specified start time
@Feature: Content Sync Plan - Positive Create
@Assert: Sync Plan is created with the specified time.
"""
plan_name = gen_string('alpha')
startdate = datetime.now() + timedelta(minutes=10)
# Formatting current_date to web-UI format "%b %d, %Y %I:%M:%S %p" and
# removed zero-padded date(%-d) and hrs(%l) as fetching via web-UI
# doesn't have it
formatted_date_time = startdate.strftime("%b %-d, %Y %-l:%M:%S %p")
# Removed the seconds info as it would be too quick to validate via UI.
starttime = formatted_date_time.rpartition(':')[0]
with Session(self.browser) as session:
make_syncplan(
session,
org=self.organization.name,
name=plan_name,
description='sync plan create with start time',
start_hour=startdate.strftime('%H'),
start_minute=startdate.strftime('%M'),
)
self.assertIsNotNone(self.syncplan.search(plan_name))
self.syncplan.search(plan_name).click()
self.syncplan.wait_for_ajax()
starttime_text = self.syncplan.wait_until_element(
locators['sp.fetch_startdate']).text
# Removed the seconds info as it would be too quick
# to validate via UI.
saved_starttime = str(starttime_text).rpartition(':')[0]
self.assertEqual(saved_starttime, starttime)
示例4: test_positive_create_with_start_date
def test_positive_create_with_start_date(self):
"""Create Sync plan with specified start date
@Feature: Content Sync Plan - Positive Create
@Assert: Sync Plan is created with the specified date
"""
plan_name = gen_string('alpha')
startdate = datetime.now() + timedelta(days=10)
startdate_str = startdate.strftime("%Y-%m-%d")
current_date_time = startdate.strftime("%b %-d, %Y %I:%M:%S %p")
# validating only for date
fetch_startdate = current_date_time.rpartition(',')[0]
with Session(self.browser) as session:
make_syncplan(
session,
org=self.organization.name,
name=plan_name,
description='sync plan create with start date',
startdate=startdate_str,
)
self.assertIsNotNone(self.syncplan.search(plan_name))
self.syncplan.search(plan_name).click()
self.syncplan.wait_for_ajax()
startdate_text = self.syncplan.wait_until_element(
locators['sp.fetch_startdate']).text
saved_startdate = str(startdate_text).rpartition(',')[0]
self.assertEqual(saved_startdate, fetch_startdate)
示例5: test_positive_create_with_start_time
def test_positive_create_with_start_time(self):
"""Create Sync plan with specified start time
:id: a4709229-325c-4027-b4dc-10a226c4d7bf
:expectedresults: Sync Plan is created with the specified time.
:BZ: 1460146
:CaseLevel: Integration
"""
plan_name = gen_string('alpha')
with Session(self) as session:
startdate = (self.get_client_datetime(session.browser)
+ timedelta(minutes=10))
make_syncplan(
session,
org=self.organization.name,
name=plan_name,
description='sync plan create with start time',
start_hour=startdate.strftime('%H'),
start_minute=startdate.strftime('%M'),
)
self.assertIsNotNone(self.syncplan.search(plan_name))
self.syncplan.click(self.syncplan.search(plan_name))
starttime_text = self.syncplan.wait_until_element(
locators['sp.fetch_startdate']).text
# Removed the seconds info as it would be too quick
# to validate via UI.
self.assertEqual(
str(starttime_text).rpartition(':')[0],
startdate.strftime("%Y/%m/%d %H:%M")
)
示例6: test_negative_synchronize_custom_product_current_sync_date
def test_negative_synchronize_custom_product_current_sync_date(self):
"""Verify product won't get synced immediately after adding association
with a sync plan which has already been started
@Feature: Sync Plan
@Assert: Repository was not synchronized
@BZ: 1279539
"""
plan_name = gen_string('alpha')
product = entities.Product(organization=self.organization).create()
repo = entities.Repository(product=product).create()
startdate = datetime.now()
with Session(self.browser) as session:
make_syncplan(
session,
org=self.organization.name,
name=plan_name,
start_hour=startdate.strftime('%H'),
start_minute=startdate.strftime('%M'),
)
self.syncplan.update(
plan_name, add_products=[product.name])
with self.assertRaises(AssertionError):
self.validate_repo_content(
product.name,
repo.name,
['errata', 'package_groups', 'packages'],
max_attempts=5,
)
示例7: test_positive_synchronize_custom_products_future_sync_date
def test_positive_synchronize_custom_products_future_sync_date(self):
"""Create a sync plan with sync date in a future and sync multiple
custom products with multiple repos automatically.
@Assert: Products are synchronized successfully.
@Feature: SyncPlan
"""
delay = 10 * 60 # delay for sync date in seconds
plan_name = gen_string('alpha')
products = [
entities.Product(organization=self.organization).create()
for _ in range(randint(3, 5))
]
repos = [
entities.Repository(product=product).create()
for product in products
for _ in range(randint(2, 3))
]
startdate = datetime.now() + timedelta(seconds=delay)
with Session(self.browser) as session:
make_syncplan(
session,
org=self.organization.name,
name=plan_name,
description='sync plan create with start time',
start_hour=startdate.strftime('%H'),
start_minute=startdate.strftime('%M'),
)
# Verify products have not been synced yet
for repo in repos:
self.validate_repo_content(
repo.product.read().name,
repo.name,
['errata', 'package_groups', 'packages'],
after_sync=False,
)
# Associate sync plan with products
self.syncplan.update(
plan_name, add_products=[product.name for product in products])
# Wait half of expected time
sleep(delay/2)
# Verify products has not been synced yet
for repo in repos:
self.validate_repo_content(
repo.product.read().name,
repo.name,
['errata', 'package_groups', 'packages'],
after_sync=False,
)
# Wait the rest of expected time
sleep(delay/2)
# Verify product was synced successfully
for repo in repos:
self.validate_repo_content(
repo.product.read().name,
repo.name,
['errata', 'package_groups', 'packages'],
)
示例8: test_positive_synchronize_rh_product_current_sync_date
def test_positive_synchronize_rh_product_current_sync_date(self):
"""Create a sync plan with current datetime as a sync date, add a
RH product and verify the product gets synchronized on the next sync
occurrence
@Assert: Product is synchronized successfully.
@Feature: SyncPlan
@BZ: 1279539
"""
interval = 60 * 60 # 'hourly' sync interval in seconds
plan_name = gen_string('alpha')
org = entities.Organization().create()
with manifests.clone() as manifest:
entities.Subscription().upload(
data={'organization_id': org.id},
files={'content': manifest.content},
)
repo_id = enable_rhrepo_and_fetchid(
basearch='x86_64',
org_id=org.id,
product=PRDS['rhel'],
repo=REPOS['rhst7']['name'],
reposet=REPOSET['rhst7'],
releasever=None,
)
repo = entities.Repository(id=repo_id).read()
startdate = datetime.now()
with Session(self.browser) as session:
make_syncplan(
session,
org=org.name,
name=plan_name,
description='sync plan create with start time',
interval=u'hourly',
start_hour=startdate.strftime('%H'),
start_minute=startdate.strftime('%M'),
)
# Associate sync plan with product
self.syncplan.update(
plan_name, add_products=[PRDS['rhel']])
# Wait half of expected time
sleep(interval / 2)
# Verify product has not been synced yet
self.validate_repo_content(
PRDS['rhel'],
repo.name,
['errata', 'package_groups', 'packages'],
after_sync=False,
)
# Wait the rest of expected time
sleep(interval / 2)
# Verify product was synced successfully
self.validate_repo_content(
PRDS['rhel'],
repo.name,
['errata', 'package_groups', 'packages'],
)
示例9: test_positive_synchronize_custom_products_future_sync_date
def test_positive_synchronize_custom_products_future_sync_date(self):
"""Create a sync plan with sync date in a future and sync multiple
custom products with multiple repos automatically.
:id: 9564e726-59c6-4d24-bb3d-f0ab3c4b26a5
:expectedresults: Products are synchronized successfully.
:CaseLevel: System
"""
delay = 5 * 60 # delay for sync date in seconds
plan_name = gen_string('alpha')
products = [
entities.Product(organization=self.organization).create()
for _ in range(3)
]
repos = [
entities.Repository(product=product).create()
for product in products
for _ in range(2)
]
with Session(self) as session:
startdate = (self.get_client_datetime(session.browser)
+ timedelta(seconds=delay))
make_syncplan(
session,
org=self.organization.name,
name=plan_name,
description='sync plan create with start time',
start_hour=startdate.strftime('%H'),
start_minute=startdate.strftime('%M'),
)
# Verify products have not been synced yet
for repo in repos:
with self.assertRaises(AssertionError):
self.validate_task_status(repo.id, max_tries=2)
# Associate sync plan with products
self.syncplan.update(
plan_name, add_products=[product.name for product in products])
# Wait third part of expected time, because it will take a while to
# verify each product and repository
self.logger.info('Waiting {0} seconds to check products'
' were not synced'.format(delay/3))
sleep(delay / 4)
# Verify products has not been synced yet
for repo in repos:
with self.assertRaises(AssertionError):
self.validate_task_status(repo.id, max_tries=2)
# Wait the rest of expected time
self.logger.info('Waiting {0} seconds to check products'
' were synced'.format(delay*2/3))
sleep(delay * 3/4)
# Verify product was synced successfully
self.validate_task_status(repo.id)
for repo in repos:
self.validate_repo_content(
repo,
['erratum', 'package', 'package_group'],
)
示例10: test_positive_synchronize_rh_product_future_sync_date
def test_positive_synchronize_rh_product_future_sync_date(self):
"""Create a sync plan with sync date in a future and sync one RH
product with it automatically.
@id: 193d0159-d4a7-4f50-b037-7289f4576ade
@Assert: Product is synchronized successfully.
@CaseLevel: System
"""
delay = 10 * 60 # delay for sync date in seconds
plan_name = gen_string('alpha')
org = entities.Organization().create()
with manifests.clone() as manifest:
entities.Subscription().upload(
data={'organization_id': org.id},
files={'content': manifest.content},
)
repo_id = enable_rhrepo_and_fetchid(
basearch='x86_64',
org_id=org.id,
product=PRDS['rhel'],
repo=REPOS['rhst7']['name'],
reposet=REPOSET['rhst7'],
releasever=None,
)
repo = entities.Repository(id=repo_id).read()
startdate = datetime.now() + timedelta(seconds=delay)
with Session(self.browser) as session:
make_syncplan(
session,
org=org.name,
name=plan_name,
description='sync plan create with start time',
interval=u'hourly',
start_hour=startdate.strftime('%H'),
start_minute=startdate.strftime('%M'),
)
# Associate sync plan with product
self.syncplan.update(
plan_name, add_products=[PRDS['rhel']])
# Wait half of expected time
sleep(delay / 2)
# Verify product has not been synced yet
self.validate_repo_content(
PRDS['rhel'],
repo.name,
['errata', 'package_groups', 'packages'],
after_sync=False,
)
# Wait the rest of expected time
sleep(delay / 2)
# Verify product was synced successfully
self.validate_repo_content(
PRDS['rhel'],
repo.name,
['errata', 'package_groups', 'packages'],
)
示例11: test_positive_synchronize_custom_product_future_sync_date
def test_positive_synchronize_custom_product_future_sync_date(self):
"""Create a sync plan with sync date in a future and sync one custom
product with it automatically.
:id: fdd3b2a2-8d8e-4a18-b6a5-363e8dd5f998
:expectedresults: Product is synchronized successfully.
:CaseLevel: System
"""
delay = 5 * 60 # delay for sync date in seconds
plan_name = gen_string('alpha')
product = entities.Product(organization=self.organization).create()
repo = entities.Repository(product=product).create()
with Session(self) as session:
startdate = (self.get_client_datetime(session.browser)
+ timedelta(seconds=delay))
make_syncplan(
session,
org=self.organization.name,
name=plan_name,
description='sync plan create with start time',
start_hour=startdate.strftime('%H'),
start_minute=startdate.strftime('%M'),
)
# Verify product is not synced and doesn't have any content
with self.assertRaises(AssertionError):
self.validate_task_status(repo.id, max_tries=2)
self.validate_repo_content(
repo,
['erratum', 'package', 'package_group'],
after_sync=False,
)
# Associate sync plan with product
self.syncplan.update(plan_name, add_products=[product.name])
# Wait half of expected time
self.logger.info('Waiting {0} seconds to check product {1}'
' was not synced'.format(delay/2, product.name))
sleep(delay / 4)
# Verify product has not been synced yet
with self.assertRaises(AssertionError):
self.validate_task_status(repo.id, max_tries=2)
self.validate_repo_content(
repo,
['erratum', 'package', 'package_group'],
after_sync=False,
)
# Wait the rest of expected time
self.logger.info('Waiting {0} seconds to check product {1}'
' was synced'.format(delay/2, product.name))
sleep(delay * 3/4)
# Verify product was synced successfully
self.validate_task_status(repo.id)
self.validate_repo_content(
repo,
['erratum', 'package', 'package_group'],
)
示例12: test_positive_synchronize_custom_product_past_sync_date
def test_positive_synchronize_custom_product_past_sync_date(self):
"""Create a sync plan with past datetime as a sync date, add a
custom product and verify the product gets synchronized on the next
sync occurrence
:id: d65e91c4-a0b6-4588-a3ff-fe9cd3762556
:expectedresults: Product is synchronized successfully.
:BZ: 1279539
:CaseLevel: System
"""
interval = 60 * 60 # 'hourly' sync interval in seconds
delay = 5 * 60
plan_name = gen_string('alpha')
product = entities.Product(organization=self.organization).create()
repo = entities.Repository(product=product).create()
with Session(self) as session:
startdate = (self.get_client_datetime(session.browser)
- timedelta(seconds=(interval - delay)))
make_syncplan(
session,
org=self.organization.name,
name=plan_name,
description='sync plan create with start time',
startdate=startdate.strftime('%Y-%m-%d'),
start_hour=startdate.strftime('%H'),
start_minute=startdate.strftime('%M'),
sync_interval='hourly',
)
# Associate sync plan with product
self.syncplan.update(
plan_name, add_products=[product.name])
# Verify product has not been synced yet
self.logger.info('Waiting {0} seconds to check product {1}'
' was not synced'.format(delay/4, product.name))
sleep(delay/4)
with self.assertRaises(AssertionError):
self.validate_task_status(repo.id, max_tries=2)
self.validate_repo_content(
repo,
['erratum', 'package', 'package_group'],
after_sync=False,
)
# Wait until the next recurrence
self.logger.info('Waiting {0} seconds to check product {1}'
' was synced'.format(delay, product.name))
sleep(delay * 3/4)
# Verify product was synced successfully
self.validate_task_status(repo.id)
self.validate_repo_content(
repo,
['erratum', 'package', 'package_group'],
)
示例13: test_negative_create_1
def test_negative_create_1(self, name):
"""@Test: Create Sync Plan with blank and whitespace in name
@Feature: Content Sync Plan - Negative Create
@Assert: Sync Plan is not created
"""
locator = common_locators["common_invalid"]
with Session(self.browser) as session:
make_syncplan(session, org=self.org_name, name=name,
submit_validate=False)
invalid = self.syncplan.wait_until_element(locator)
self.assertIsNotNone(invalid)
示例14: test_positive_synchronize_custom_product_future_sync_date
def test_positive_synchronize_custom_product_future_sync_date(self):
"""Create a sync plan with sync date in a future and sync one custom
product with it automatically.
@id: fdd3b2a2-8d8e-4a18-b6a5-363e8dd5f998
@Assert: Product is synchronized successfully.
@CaseLevel: System
"""
delay = 10 * 60 # delay for sync date in seconds
plan_name = gen_string('alpha')
product = entities.Product(organization=self.organization).create()
repo = entities.Repository(product=product).create()
startdate = datetime.now() + timedelta(seconds=delay)
with Session(self.browser) as session:
make_syncplan(
session,
org=self.organization.name,
name=plan_name,
description='sync plan create with start time',
start_hour=startdate.strftime('%H'),
start_minute=startdate.strftime('%M'),
)
# Verify product is not synced and doesn't have any content
self.validate_repo_content(
product.name,
repo.name,
['errata', 'package_groups', 'packages'],
after_sync=False,
)
# Associate sync plan with product
self.syncplan.update(plan_name, add_products=[product.name])
# Wait half of expected time
sleep(delay/2)
# Verify product has not been synced yet
self.validate_repo_content(
product.name,
repo.name,
['errata', 'package_groups', 'packages'],
after_sync=False,
)
# Wait the rest of expected time
sleep(delay/2)
# Verify product was synced successfully
self.validate_repo_content(
product.name,
repo.name,
['errata', 'package_groups', 'packages'],
)
示例15: test_negative_create_2
def test_negative_create_2(self, name):
"""@Test: Create Sync Plan with 256 characters in name
@Feature: Content Sync Plan - Negative Create
@Assert: Sync Plan is not created with more than 255 chars
"""
description = 'more than 255 chars'
with Session(self.browser) as session:
make_syncplan(session, org=self.org_name, name=name,
description=description, submit_validate=False)
self.assertIsNotNone(self.syncplan.wait_until_element(
common_locators['common_invalid']))