本文整理汇总了Python中taiga.models.Project类的典型用法代码示例。如果您正苦于以下问题:Python Project类的具体用法?Python Project怎么用?Python Project使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Project类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_import_milestone
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)
示例2: test_issues_stats
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
)
示例3: test_get_userstories_by_ref
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")
示例4: test_get_issues_by_ref
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")
示例5: test_unstar
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
)
示例6: test_import_issue
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)
示例7: test_stats
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: test_list_membership
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)
示例9: test_list_user_story_attributes
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)
示例10: test_import_task
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')
示例11: test_import_wikipage
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')
示例12: test_add_priority
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')
示例13: test_list_priorities
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)
示例14: test_add_issue_status
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")
示例15: test_unstar
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)