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()