Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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")
Beispiel #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
     )
Beispiel #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")
Beispiel #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")
Beispiel #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
     )
Beispiel #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")
Beispiel #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")
Beispiel #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'}
     )
Beispiel #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"
     })
Beispiel #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)
Beispiel #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)
Beispiel #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')
Beispiel #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')
Beispiel #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)
Beispiel #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)
Beispiel #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')
Beispiel #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)
Beispiel #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')
Beispiel #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')
Beispiel #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')
Beispiel #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')
Beispiel #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")
Beispiel #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')
Beispiel #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)
Beispiel #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')
Beispiel #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')
Beispiel #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)
Beispiel #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')
Beispiel #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")
Beispiel #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')
Beispiel #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)
Beispiel #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')
Beispiel #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')
Beispiel #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)
Beispiel #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')
Beispiel #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')
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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')
Beispiel #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')
Beispiel #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')
Beispiel #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)
Beispiel #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')
Beispiel #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")
Beispiel #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)
Beispiel #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")
Beispiel #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")
Beispiel #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)
Beispiel #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')
Beispiel #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")