コード例 #1
0
ファイル: test_jira.py プロジェクト: pawel-lewtak/economic-py
 def test_hours_without_worklog(self):
     responses.add(responses.GET, 'http://jira.example.com/issue/TEST-1/worklog',
                   body='{"startAt":0,"maxResults":50,"total":1,"worklogs":[]}', status=200,
                   content_type='application/json')
     config = copy.copy(CONFIG)
     jira = Jira(config)
     assert 0.0 == jira.get_hours('TEST-1')
コード例 #2
0
ファイル: test_jira.py プロジェクト: pawel-lewtak/economic-py
 def test_hours_with_worklog(self):
     now = datetime.datetime.now()
     responses.add(responses.GET, 'http://jira.example.com/issue/TEST-1/worklog',
                   body='{"startAt":0,"maxResults":50,"total":1,"worklogs":[{"author":{"name":"sample_username"},"timeSpentSeconds":1800,"started":"%s"},{"author":{"name":"other_user"},"timeSpentSeconds":3600,"started":"%s"}]}' % (now, now),
                   status=200,
                   content_type='application/json')
     config = copy.copy(CONFIG)
     jira = Jira(config)
     assert 0.5 == jira.get_hours('TEST-1')
コード例 #3
0
 def test_hours_without_worklog(self):
     responses.add(
         responses.GET,
         'http://jira.example.com/issue/TEST-1/worklog',
         body='{"startAt":0,"maxResults":50,"total":1,"worklogs":[]}',
         status=200,
         content_type='application/json')
     config = copy.copy(CONFIG)
     jira = Jira(config)
     assert 0.0 == jira.get_hours('TEST-1')
コード例 #4
0
 def test_hours_with_worklog(self):
     now = datetime.datetime.now()
     responses.add(
         responses.GET,
         'http://jira.example.com/issue/TEST-1/worklog',
         body=
         '{"startAt":0,"maxResults":50,"total":1,"worklogs":[{"author":{"name":"sample_username"},"timeSpentSeconds":1800,"started":"%s"},{"author":{"name":"other_user"},"timeSpentSeconds":3600,"started":"%s"}]}'
         % (now, now),
         status=200,
         content_type='application/json')
     config = copy.copy(CONFIG)
     jira = Jira(config)
     assert 0.5 == jira.get_hours('TEST-1')