示例#1
0
 def test_add_milestone(self, mock_new_milestone):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     time1 = datetime.now()
     time2 = datetime.now()
     project.add_milestone('Milestone 1', time1, time2)
     mock_new_milestone.assert_called_with(1, 'Milestone 1', time1, time2)
示例#2
0
 def test_add_milestone(self, mock_new_milestone):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     time1 = datetime.now()
     time2 = datetime.now()
     project.add_milestone("Milestone 1", time1, time2)
     mock_new_milestone.assert_called_with(1, "Milestone 1", time1, time2)
示例#3
0
 def test_stats(self, mock_requestmaker_get):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     project.stats()
     mock_requestmaker_get.assert_called_with("/{endpoint}/{id}/stats",
                                              endpoint="projects",
                                              id=1)
示例#4
0
 def test_unstar(self, mock_requestmaker_post):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     self.assertEqual(project.unstar().id, 1)
     mock_requestmaker_post.assert_called_with("/{endpoint}/{id}/unstar",
                                               endpoint="projects",
                                               id=1)
示例#5
0
 def test_import_milestone(self, mock_import_milestone):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     time1 = datetime.now()
     time2 = datetime.now()
     project.import_milestone("Milestone 1", time1, time2)
     mock_import_milestone.assert_called_with(1, "Milestone 1", time1, time2)
示例#6
0
 def test_import_milestone(self, mock_import_milestone):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     time1 = datetime.now()
     time2 = datetime.now()
     project.import_milestone('Milestone 1', time1, time2)
     mock_import_milestone.assert_called_with(1, 'Milestone 1', time1, time2)
示例#7
0
 def test_stats(self, mock_requestmaker_get):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.stats()
     mock_requestmaker_get.assert_called_with('/{endpoint}/{id}/stats',
                                              endpoint='projects',
                                              id=1)
示例#8
0
 def test_unstar(self, mock_requestmaker_post):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     self.assertEqual(project.unstar().id, 1)
     mock_requestmaker_post.assert_called_with('/{endpoint}/{id}/unstar',
                                               endpoint='projects',
                                               id=1)
示例#9
0
 def test_get_tasks_by_ref(self, mock_requestmaker_get):
     mock_requestmaker_get.return_value = MockResponse(
         200, create_mock_json('tests/resources/task_details_success.json'))
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     api = TaigaAPI(token='f4k3')
     task = project.get_task_by_ref(1)
     self.assertEqual(task.description, "Implement API CALL")
示例#10
0
 def test_unstar(self, mock_requestmaker_post):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     self.assertEqual(project.unstar().id, 1)
     mock_requestmaker_post.assert_called_with(
         '/{endpoint}/{id}/unstar',
         endpoint='projects', id=1
     )
示例#11
0
 def test_get_userstories_by_ref(self, mock_requestmaker_get):
     mock_requestmaker_get.return_value = MockResponse(200,
         create_mock_json('tests/resources/userstory_details_success.json'))
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     api = TaigaAPI(token='f4k3')
     us = project.get_userstory_by_ref(1)
     self.assertEqual(us.description, "Description of the story")
示例#12
0
 def test_get_issues_by_ref(self, mock_requestmaker_get):
     mock_requestmaker_get.return_value = MockResponse(200,
         create_mock_json('tests/resources/issue_details_success.json'))
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     api = TaigaAPI(token='f4k3')
     issue = project.get_issue_by_ref(31)
     self.assertEqual(issue.description, "Implement API CALL")
示例#13
0
 def test_issues_stats(self, mock_requestmaker_get):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.issues_stats()
     mock_requestmaker_get.assert_called_with(
         '/{endpoint}/{id}/issues_stats',
         endpoint='projects', id=1
     )
示例#14
0
 def test_get_issues_by_ref(self, mock_requestmaker_get):
     mock_requestmaker_get.return_value = MockResponse(
         200,
         create_mock_json("tests/resources/issue_details_success.json"))
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     TaigaAPI(token="f4k3")
     issue = project.get_issue_by_ref(31)
     self.assertEqual(issue.description, "Implement API CALL")
示例#15
0
 def test_get_userstories_by_ref(self, mock_requestmaker_get):
     mock_requestmaker_get.return_value = MockResponse(
         200,
         create_mock_json('tests/resources/userstory_details_success.json'))
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     api = TaigaAPI(token='f4k3')
     us = project.get_userstory_by_ref(1)
     self.assertEqual(us.description, "Description of the story")
示例#16
0
 def test_create_project(self, mock_new_resource):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     mock_new_resource.return_value = Project(rm)
     Projects(rm).create('PR 1', 'PR desc 1')
     mock_new_resource.assert_called_with(
         payload={'name': 'PR 1', 'description': 'PR desc 1'}
     )
示例#17
0
 def test_create_project(self, mock_new_resource):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     mock_new_resource.return_value = Project(rm)
     Projects(rm).create("PR 1", "PR desc 1")
     mock_new_resource.assert_called_with(payload={
         "name": "PR 1",
         "description": "PR desc 1"
     })
示例#18
0
 def test_add_membership(self, mock_new_membership):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     project.add_membership("*****@*****.**", 1)
     mock_new_membership.assert_called_with(1, "*****@*****.**", 1)
示例#19
0
 def test_list_task_statuses(self, mock_list_task_statuses):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.list_task_statuses()
     mock_list_task_statuses.assert_called_with(project=1)
示例#20
0
 def test_add_issue_type(self, mock_new_issue_type):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_issue_type('Severity 1')
     mock_new_issue_type.assert_called_with(1, 'Severity 1')
示例#21
0
 def test_add_priority(self, mock_new_priority):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_priority('Priority 1')
     mock_new_priority.assert_called_with(1, 'Priority 1')
示例#22
0
 def test_list_epics(self, mock_list_epics):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     project.list_epics()
     mock_list_epics.assert_called_with(project=1)
示例#23
0
 def test_list_membership(self, mock_list_memberships):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.list_memberships()
     mock_list_memberships.assert_called_with(project=1)
示例#24
0
 def test_import_task(self, mock_import_task):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.import_task('Task 1', 'New')
     mock_import_task.assert_called_with(1, 'Task 1', 'New')
示例#25
0
 def test_add_point(self, mock_new_point):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_point('Point 1', 1.5)
     mock_new_point.assert_called_with(1, 'Point 1', 1.5)
示例#26
0
 def test_add_issue_type(self, mock_new_issue_type):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_issue_type('Severity 1')
     mock_new_issue_type.assert_called_with(1, 'Severity 1')
示例#27
0
 def test_add_task_status(self, mock_new_task_status):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_task_status('Task status 1')
     mock_new_task_status.assert_called_with(1, 'Task status 1')
示例#28
0
 def test_add_role(self, mock_new_role):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_role('Role 1')
     mock_new_role.assert_called_with(1, 'Role 1')
示例#29
0
 def test_add_priority(self, mock_new_priority):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_priority('Priority 1')
     mock_new_priority.assert_called_with(1, 'Priority 1')
示例#30
0
 def test_add_webhook(self, mock_new_webhook):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     project.add_webhook("New Webhook", "webhook-url", "webhook-key")
     mock_new_webhook.assert_called_with(1, "New Webhook", "webhook-url",
                                         "webhook-key")
示例#31
0
 def test_import_userstory(self, mock_import_userstory):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.import_user_story('US 1', 'Closed')
     mock_import_userstory.assert_called_with(1, 'US 1', 'Closed')
示例#32
0
 def test_import_issue(self, mock_import_issue):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.import_issue('Issue 1', 1, 2, 3, 4)
     mock_import_issue.assert_called_with(1, 'Issue 1', 1, 2, 3, 4)
示例#33
0
 def test_import_wikipage(self, mock_import_wikipage):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.import_wikipage('Slug 1', 'Content')
     mock_import_wikipage.assert_called_with(1, 'Slug 1', 'Content')
示例#34
0
 def test_import_userstory(self, mock_import_userstory):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.import_user_story('US 1', 'Closed')
     mock_import_userstory.assert_called_with(1, 'US 1', 'Closed')
示例#35
0
 def test_list_user_story_attributes(self, mock_list_us_attr):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.list_user_story_attributes()
     mock_list_us_attr.assert_called_with(project=1)
示例#36
0
 def test_add_wikipage(self, mock_new_wikipage):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_wikipage('WP 1', 'Content')
     mock_new_wikipage.assert_called_with(1, 'WP 1', 'Content')
示例#37
0
 def test_import_task(self, mock_import_task):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     project.import_task("Task 1", "New")
     mock_import_task.assert_called_with(1, "Task 1", "New")
示例#38
0
 def test_import_wikipage(self, mock_import_wikipage):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.import_wikipage('Slug 1', 'Content')
     mock_import_wikipage.assert_called_with(1, 'Slug 1', 'Content')
示例#39
0
 def test_stats(self, mock_requestmaker_get):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     project.stats()
     mock_requestmaker_get.assert_called_with("/{endpoint}/{id}/stats", endpoint="projects", id=1)
示例#40
0
 def test_import_wikilink(self, mock_import_wikilink):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.import_wikilink('WL 1', 'href')
     mock_import_wikilink.assert_called_with(1, 'WL 1', 'href')
示例#41
0
 def test_add_role(self, mock_new_role):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_role('Role 1')
     mock_new_role.assert_called_with(1, 'Role 1')
示例#42
0
 def test_list_priorities(self, mock_list_priorities):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     project.list_priorities()
     mock_list_priorities.assert_called_with(project=1)
示例#43
0
 def test_add_task_status(self, mock_new_task_status):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_task_status('Task status 1')
     mock_new_task_status.assert_called_with(1, 'Task status 1')
示例#44
0
 def test_add_user_story_attribute(self, mock_new_us_attr):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_user_story_attribute('New Attribute')
     mock_new_us_attr.assert_called_with(1, 'New Attribute')
示例#45
0
 def test_add_point(self, mock_new_point):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_point('Point 1', 1.5)
     mock_new_point.assert_called_with(1, 'Point 1', 1.5)
示例#46
0
 def test_list_user_story_attributes(self, mock_list_us_attr):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.list_user_story_attributes()
     mock_list_us_attr.assert_called_with(project=1)
示例#47
0
 def test_import_issue(self, mock_import_issue):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.import_issue('Issue 1', 1, 2, 3, 4)
     mock_import_issue.assert_called_with(1, 'Issue 1', 1, 2, 3, 4)
示例#48
0
 def test_add_membership(self, mock_new_membership):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_membership('*****@*****.**', 1)
     mock_new_membership.assert_called_with(1, '*****@*****.**', 1)
示例#49
0
 def test_add_wikipage(self, mock_new_wikipage):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_wikipage('WP 1', 'Content')
     mock_new_wikipage.assert_called_with(1, 'WP 1', 'Content')
示例#50
0
 def test_add_webhook(self, mock_new_webhook):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_webhook('New Webhook', 'webhook-url', 'webhook-key')
     mock_new_webhook.assert_called_with(1, 'New Webhook', 'webhook-url',
                                         'webhook-key')
示例#51
0
 def test_import_wikilink(self, mock_import_wikilink):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.import_wikilink('WL 1', 'href')
     mock_import_wikilink.assert_called_with(1, 'WL 1', 'href')
示例#52
0
 def test_list_webhooks(self, mock_list_webhooks):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.list_webhooks()
     mock_list_webhooks.assert_called_with(project=1)
示例#53
0
 def test_add_user_story_attribute(self, mock_new_us_attr):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_user_story_attribute('New Attribute')
     mock_new_us_attr.assert_called_with(1, 'New Attribute')
示例#54
0
 def test_add_priority(self, mock_new_priority):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     project.add_priority("Priority 1")
     mock_new_priority.assert_called_with(1, "Priority 1")
示例#55
0
 def test_add_membership(self, mock_new_membership):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.add_membership('*****@*****.**', 1)
     mock_new_membership.assert_called_with(1, '*****@*****.**', 1)
示例#56
0
 def test_add_issue_status(self, mock_new_issue_status):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     project.add_issue_status("Issue 1")
     mock_new_issue_status.assert_called_with(1, "Issue 1")
示例#57
0
 def test_add_user_story_attribute(self, mock_new_us_attr):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     project.add_user_story_attribute("New Attribute")
     mock_new_us_attr.assert_called_with(1, "New Attribute")
示例#58
0
 def test_unstar(self, mock_requestmaker_post):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     self.assertEqual(project.unstar().id, 1)
     mock_requestmaker_post.assert_called_with("/{endpoint}/{id}/unstar", endpoint="projects", id=1)
示例#59
0
 def test_import_task(self, mock_import_task):
     rm = RequestMaker('/api/v1', 'fakehost', 'faketoken')
     project = Project(rm, id=1)
     project.import_task('Task 1', 'New')
     mock_import_task.assert_called_with(1, 'Task 1', 'New')
示例#60
0
 def test_add_epic(self, mock_new_epic):
     rm = RequestMaker("/api/v1", "fakehost", "faketoken")
     project = Project(rm, id=1)
     project.add_epic("Epic 1")
     mock_new_epic.assert_called_with(1, "Epic 1")