def test_bad_character(self): """this test validates that non UTF-8 characters will cause an error """ test_case = TestCase() steps = TestSteps() with self.assertRaises(PylarionLibException): # check _obj_setter test_case.status = u"é".encode('latin') with self.assertRaises(PylarionLibException): # check _custom_setter test_case.tcmscaseid = u"é".encode('latin') with self.assertRaises(PylarionLibException): # check _regular_setter test_case.title = u"é".encode('latin') with self.assertRaises(PylarionLibException): # check _arr_obj_setter steps.keys = [u"é".encode('latin')]
def test_006_create_work_item(self): tc = TestCase() tc.title = "regression" tc.description = "regression document test" tc.status = "draft" tc.caseimportance = "high" tc.caselevel = "component" tc.caseautomation = "notautomated" tc.caseposneg = "positive" tc.testtype = "functional" tc.subtype1 = "-" doc = Document(uri=self.doc_create.uri) wi = doc.create_work_item(None, tc) doc_wis = doc.get_work_items(None, True) doc_wi_ids = [doc_wi.work_item_id for doc_wi in doc_wis] self.assertIn(wi.work_item_id, doc_wi_ids) global WI_ID WI_ID = wi.work_item_id
def test_019_update(self): tc = TestCase(project_id=DEFAULT_PROJ, work_item_id=self.work_item_id) tc.status = "approved" tc.update() tc2 = TestCase(project_id=DEFAULT_PROJ, work_item_id=self.work_item_id) self.assertEqual(tc2.status, "approved")
# if tc.description: # tc.description = tc._check_encode(tc.description) # else: # tc.description = "TBD" # tc.description.decode('utf-8') # tc.automation_script = "https://rhos-qe-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/" # auto_test_id = tc.get_custom_field('automation-test-id').value # tc.automation_script = auto_test_id try: # tc.add_approvee('achernet') # tc.edit_approval('achernet','approved') # if tc.customerscenario == False: tc.status = 'proposed' # tc.automation_script = tc._check_encode(tc.automation_script) # tc.customerscenario = True tc.update() except StandardError: print 'Why, like this?' print "Unexpected error:", sys.exc_info()[0] # except: # print "Unexpected error:", sys.exc_info()[0] #tc.status="approved" # tc.get_custom_field('automation-test-id').value = tc._check_encode(tc.get_custom_field('automation-test-id').value)