def test_single_user_parsing(self, mock_requestmaker_get): mock_requestmaker_get.return_value = MockResponse(200, create_mock_json('tests/resources/search_success.json')) api = TaigaAPI(token='f4k3') search_result = api.search(1, 'NEW') self.assertEqual(len(search_result.tasks), 1) self.assertEqual(len(search_result.user_stories), 1) self.assertEqual(len(search_result.issues), 1) self.assertEqual(len(search_result.wikipages), 1) self.assertTrue(isinstance(search_result.tasks[0], Task)) self.assertTrue(isinstance(search_result.issues[0], Issue)) self.assertTrue(isinstance(search_result.user_stories[0], UserStory)) self.assertTrue(isinstance(search_result.wikipages[0], WikiPage))
def test_single_user_parsing(self, mock_requestmaker_get): mock_requestmaker_get.return_value = MockResponse( 200, create_mock_json('tests/resources/search_success.json')) api = TaigaAPI(token='f4k3') search_result = api.search(1, 'NEW') self.assertEqual(len(search_result.tasks), 1) self.assertEqual(len(search_result.user_stories), 1) self.assertEqual(len(search_result.issues), 1) self.assertEqual(len(search_result.wikipages), 1) self.assertTrue(isinstance(search_result.tasks[0], Task)) self.assertTrue(isinstance(search_result.issues[0], Issue)) self.assertTrue(isinstance(search_result.user_stories[0], UserStory)) self.assertTrue(isinstance(search_result.wikipages[0], WikiPage))
except TaigaException: projects[0].like() api.milestones.list() projects = api.projects.list() print (projects) another_new_project = projects.get(name='TEST PROJECT 3') print (another_new_project) users = api.users.list() print (users) print (api.search(projects.get(name='TEST PROJECT 3').id, 'New').user_stories[0].subject) print new_project.add_issue_attribute( 'Device', description='(iPad, iPod, iPhone, Desktop, etc.)' ) print(new_project.roles) memberships = new_project.list_memberships() new_project.add_role('New role', permissions=["add_issue", "modify_issue"]) new_project.add_membership('*****@*****.**', new_project.roles[0].id) for membership in memberships: print (membership.role_name)
api.milestones.list() projects = api.projects.list() print(projects) another_new_project = projects.get(name='TEST PROJECT 3') print(another_new_project) users = api.users.list() print(users) print( api.search(projects.get(name='TEST PROJECT 3').id, 'New').user_stories[0].subject) print new_project.add_issue_attribute( 'Device', description='(iPad, iPod, iPhone, Desktop, etc.)') print(new_project.roles) memberships = new_project.list_memberships() new_project.add_role('New role', permissions=["add_issue", "modify_issue"]) new_project.add_membership('*****@*****.**', new_project.roles[0].id) for membership in memberships: print(membership.role_name)