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')
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')
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')
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')