def test_bugzilla_1127382(self): """ @Test: hammer puppet-module <info,list> --help @Feature: puppet-module info/list @Assert: Assert product option are present """ # puppet-module list --help: result = PuppetModule.list({'help': True}) # get list of lines and check they all are unique lines = [line['message'] for line in result.stdout] self.assertEqual(len(set(lines)), len(lines), 'The help should not have repeat options') product_options = [line for line in lines if line.startswith('--product')] self.assertGreater(len(product_options), 0, 'At least one --product option should be present') # puppet-module info --help:info, ignore exception result = PuppetModule.info({'help': True}) # get list of lines and check they all are unique lines = [line for line in result.stdout['options']] self.assertEqual(len(set(lines)), len(lines), 'The help should not have repeat options') product_options = [line for line in lines if line.startswith('--product')] self.assertGreater(len(product_options), 0, 'At least one --product option should be present')
def test_bugzilla_1127382(self): """@Test: hammer puppet-module <info,list> --help @Feature: puppet-module info/list @Assert: Assert product option are present """ # puppet-module list --help: result = PuppetModule.list({'help': True}) # get list of lines and check they all are unique lines = [line['message'] for line in result.stdout] self.assertEqual(len(set(lines)), len(lines), 'The help should not have repeat options') product_options = [line for line in lines if line.startswith('--product')] self.assertGreater(len(product_options), 0, 'At least one --product option should be present') # puppet-module info --help:info, ignore exception result = PuppetModule.info({'help': True}) # get list of lines and check they all are unique lines = [line for line in result.stdout['options']] self.assertEqual(len(set(lines)), len(lines), 'The help should not have repeat options') product_options = [line for line in lines if line.startswith('--product')] self.assertGreater(len(product_options), 0, 'At least one --product option should be present')
def test_positive_info(self): """Check if puppet-module info retrieves info for the given puppet-module id @id: 8aaa9243-5e20-49d6-95ce-620cc1ba18dc @Assert: The puppet-module info is retrieved """ return_value = PuppetModule.list({ 'organization-id': self.org['id'], }) for i in range(len(return_value)): result = PuppetModule.info({'id': return_value[i]['id']}, output_format='json') self.assertEqual(result['id'], return_value[i]['id'])
def test_positive_info(module_setup): """Check if puppet-module info retrieves info for the given puppet-module id :id: 8aaa9243-5e20-49d6-95ce-620cc1ba18dc :expectedresults: The puppet-module info is retrieved :CaseImportance: Critical """ return_value = PuppetModule.list( {'organization-id': module_setup['org'].id}) for i in range(len(return_value)): result = PuppetModule.info({'id': return_value[i]['id']}, output_format='json') assert result['id'] == return_value[i]['id']
def test_positive_info(self): """Check if puppet-module info retrieves info for the given puppet-module id @id: 8aaa9243-5e20-49d6-95ce-620cc1ba18dc @Assert: The puppet-module info is retrieved """ return_value = PuppetModule.list({ 'organization-id': self.org['id'], }) for i in range(len(return_value)): result = PuppetModule.info( {'id': return_value[i]['id']}, output_format='json' ) self.assertEqual(result['id'], return_value[i]['id'])
def test_puppet_module_info(self): """@Test: Check if puppet-module info retrieves info for the given puppet-module id @Feature: Puppet-module @Assert: The puppet-module info is retrieved """ return_value = PuppetModule.list({ 'organization-id': self.org['id'], }) for i in range(len(return_value)): result = PuppetModule.info( {'id': return_value[i]['id']}, output_format='json' ) self.assertEqual(result['ID'], return_value[i]['id'])