def test_positive_list_job_template_with_saved_org_and_loc(self): """List available job templates with saved default organization and location in config :id: 4fd05dd7-53e3-41ba-ba90-6181a7190ad8 :expectedresults: The Job Template can be listed without errors :BZ: 1368173 """ template_name = gen_string('alpha') location = make_location() make_job_template( { 'organizations': self.organization['name'], 'name': template_name, 'file': TEMPLATE_FILE, } ) templates = JobTemplate.list({'organization-id': self.organization['id']}) self.assertGreaterEqual(len(templates), 1) Defaults.add({'param-name': 'organization_id', 'param-value': self.organization['id']}) Defaults.add({'param-name': 'location_id', 'param-value': location['id']}) try: templates = JobTemplate.list() self.assertGreaterEqual(len(templates), 1) finally: Defaults.delete({'param-name': 'organization_id'}) Defaults.delete({'param-name': 'location_id'})
def test_positive_delete_job_template(self): """Delete a job template @id: 33104c04-20e9-47aa-99da-4bf3414ea31a @Assert: The Job Template has been deleted """ template_name = gen_string("alpha", 7) make_job_template({u"organizations": self.organization["name"], u"name": template_name, u"file": TEMPLATE_FILE}) JobTemplate.delete({u"name": template_name}) with self.assertRaises(CLIReturnCodeError): JobTemplate.info({u"name": template_name})
def test_positive_delete_job_template(self): """Delete a job template @id: 33104c04-20e9-47aa-99da-4bf3414ea31a @Assert: The Job Template has been deleted """ template_name = gen_string('alpha', 7) make_job_template({ u'organizations': self.organization['name'], u'name': template_name, u'file': TEMPLATE_FILE }) JobTemplate.delete({u'name': template_name}) with self.assertRaises(CLIReturnCodeError): JobTemplate.info({u'name': template_name})
def test_positive_delete_job_template(self): """Delete a job template :id: 33104c04-20e9-47aa-99da-4bf3414ea31a :expectedresults: The Job Template has been deleted :CaseImportance: Critical """ template_name = gen_string('alpha', 7) make_job_template({ u'organizations': self.organization['name'], u'name': template_name, u'file': TEMPLATE_FILE }) JobTemplate.delete({u'name': template_name}) with self.assertRaises(CLIReturnCodeError): JobTemplate.info({u'name': template_name})
def test_positive_delete_job_template(self): """Delete a job template :id: 33104c04-20e9-47aa-99da-4bf3414ea31a :expectedresults: The Job Template has been deleted :CaseImportance: Critical """ template_name = gen_string('alpha', 7) make_job_template({ 'organizations': self.organization['name'], 'name': template_name, 'file': TEMPLATE_FILE, }) JobTemplate.delete({'name': template_name}) with self.assertRaises(CLIReturnCodeError): JobTemplate.info({'name': template_name})
def test_positive_create_job_template(self): """Create a simple Job Template @id: a5a67b10-61b0-4362-b671-9d9f095c452c @Assert: The job template was successfully created """ template_name = gen_string("alpha", 7) make_job_template({u"organizations": self.organization["name"], u"name": template_name, u"file": TEMPLATE_FILE}) self.assertIsNotNone(JobTemplate.info({u"name": template_name}))
def test_positive_view_dump(self): """Export contents of a job template @id: 25fcfcaa-fc4c-425e-919e-330e36195c4a @Assert: Verify no errors are thrown """ template_name = gen_string("alpha", 7) make_job_template({u"organizations": self.organization["name"], u"name": template_name, u"file": TEMPLATE_FILE}) dumped_content = JobTemplate.dump({u"name": template_name}) self.assertGreater(len(dumped_content), 0)
def test_positive_create_job_template(self): """Create a simple Job Template @id: a5a67b10-61b0-4362-b671-9d9f095c452c @Assert: The job template was successfully created """ template_name = gen_string('alpha', 7) make_job_template({ u'organizations': self.organization['name'], u'name': template_name, u'file': TEMPLATE_FILE }) self.assertIsNotNone(JobTemplate.info({u'name': template_name}))
def test_positive_list_job_template_with_saved_org_and_loc(self): """List available job templates with saved default organization and location in config :id: 4fd05dd7-53e3-41ba-ba90-6181a7190ad8 :expectedresults: The Job Template can be listed without errors :BZ: 1368173 :CaseImportance: Critical """ template_name = gen_string('alpha') location = make_location() make_job_template({ u'organizations': self.organization['name'], u'name': template_name, u'file': TEMPLATE_FILE, }) templates = JobTemplate.list({ 'organization-id': self.organization['id']}) self.assertGreaterEqual(len(templates), 1) Defaults.add({ u'param-name': 'organization_id', u'param-value': self.organization['id'], }) Defaults.add({ u'param-name': 'location_id', u'param-value': location['id'], }) try: templates = JobTemplate.list() self.assertGreaterEqual(len(templates), 1) finally: Defaults.delete({u'param-name': 'organization_id'}) Defaults.delete({u'param-name': 'location_id'})
def test_positive_view_dump(self): """Export contents of a job template @id: 25fcfcaa-fc4c-425e-919e-330e36195c4a @Assert: Verify no errors are thrown """ template_name = gen_string('alpha', 7) make_job_template({ u'organizations': self.organization['name'], u'name': template_name, u'file': TEMPLATE_FILE }) dumped_content = JobTemplate.dump({u'name': template_name}) self.assertGreater(len(dumped_content), 0)
def test_positive_create_job_template(self): """Create a simple Job Template :id: a5a67b10-61b0-4362-b671-9d9f095c452c :expectedresults: The job template was successfully created :CaseImportance: Critical """ template_name = gen_string('alpha', 7) make_job_template({ 'organizations': self.organization['name'], 'name': template_name, 'file': TEMPLATE_FILE, }) self.assertIsNotNone(JobTemplate.info({'name': template_name}))
def test_positive_view_dump(module_org): """Export contents of a job template :id: 25fcfcaa-fc4c-425e-919e-330e36195c4a :expectedresults: Verify no errors are thrown """ template_name = gen_string('alpha', 7) make_job_template({ 'organizations': module_org.name, 'name': template_name, 'file': TEMPLATE_FILE, }) dumped_content = JobTemplate.dump({'name': template_name}) assert len(dumped_content) > 0
def test_positive_view_dump(self): """Export contents of a job template :id: 25fcfcaa-fc4c-425e-919e-330e36195c4a :expectedresults: Verify no errors are thrown :CaseImportance: Critical """ template_name = gen_string('alpha', 7) make_job_template({ u'organizations': self.organization['name'], u'name': template_name, u'file': TEMPLATE_FILE }) dumped_content = JobTemplate.dump({u'name': template_name}) self.assertGreater(len(dumped_content), 0)
def test_positive_create_job_template(self): """Create a simple Job Template :id: a5a67b10-61b0-4362-b671-9d9f095c452c :expectedresults: The job template was successfully created :CaseImportance: Critical """ template_name = gen_string('alpha', 7) make_job_template({ u'organizations': self.organization['name'], u'name': template_name, u'file': TEMPLATE_FILE }) self.assertIsNotNone( JobTemplate.info({u'name': template_name}) )