def list_workitems_in_doc(self, doc_name_with_space): if doc_name_with_space.find('/') < 0: print("Document format should be: 'space/document'") exit(1) doc = Document(Document.default_project, doc_name_with_space) fields = [ 'work_item_id', 'author', 'title', 'type', 'status', 'assignee', 'categories', 'comments', 'created', 'approvals', 'updated' ] self.workitem_list = doc.get_work_items(None, True, fields) return self.workitem_list
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