def test_negative_create_non_yum_with_download_policy(self): """Verify that non-YUM repositories cannot be created with download policy @id: 71388973-50ea-4a20-9406-0aca142014ca @Assert: Non-YUM repository is not created with a download policy """ non_yum_repo_types = [item for item in REPO_TYPE.keys() if item != "yum"] for content_type in non_yum_repo_types: with self.subTest(content_type): with self.assertRaisesRegex( CLIFactoryError, u"Validation failed: Download policy cannot be set for " "non-yum repositories" ): self._make_repository({u"content-type": content_type, u"download-policy": u"on_demand"})
def test_negative_create_non_yum_with_download_policy(self): """Verify that non-YUM repositories cannot be created with download policy @id: 71388973-50ea-4a20-9406-0aca142014ca @Assert: Non-YUM repository is not created with a download policy """ non_yum_repo_types = [ item for item in REPO_TYPE.keys() if item != 'yum' ] for content_type in non_yum_repo_types: with self.subTest(content_type): with self.assertRaises(CLIFactoryError): self._make_repository({ u'content-type': content_type, u'download-policy': u'on_demand' })
def test_negative_create_non_yum_with_download_policy(self): """Verify that non-YUM repositories cannot be created with download policy @id: 71388973-50ea-4a20-9406-0aca142014ca @Assert: Non-YUM repository is not created with a download policy """ non_yum_repo_types = [ repo_type for repo_type in REPO_TYPE.keys() if repo_type != 'yum' ] for content_type in non_yum_repo_types: with self.subTest(content_type): with self.assertRaises(HTTPError): entities.Repository(product=self.product, content_type=content_type, download_policy='on_demand').create()
def test_negative_create_non_yum_with_download_policy(self): """Verify that non-YUM repositories cannot be created with download policy @id: 71388973-50ea-4a20-9406-0aca142014ca @Assert: Non-YUM repository is not created with a download policy """ non_yum_repo_types = [ repo_type for repo_type in REPO_TYPE.keys() if repo_type != 'yum' ] for content_type in non_yum_repo_types: with self.subTest(content_type): with self.assertRaises(HTTPError): entities.Repository( product=self.product, content_type=content_type, download_policy='on_demand' ).create()
def test_negative_download_policy_displayed_for_non_yum_repo(self): """Verify that non-YUM repositories cannot be created with download policy @id: 47d55251-5f89-443d-b980-a441da34e205 @Assert: Dropdown for download policy is not displayed for non-yum repo """ non_yum_repo_types = [ repo_type for repo_type in REPO_TYPE.values() if repo_type != 'yum' ] with Session(self.browser): for content_type in non_yum_repo_types: self.products.search_and_click(self.session_prod.name) with self.subTest(content_type): self.repository.navigate_to_entity() self.repository.click(locators['repo.new']) self.repository.assign_value(common_locators['name'], gen_string('alphanumeric')) self.repository.assign_value(locators['repo.type'], content_type) self.assertIsNone( self.repository.find_element( locators['repo.download_policy']))