コード例 #1
0
ファイル: test_jira.py プロジェクト: pawel-lewtak/economic-py
 def test_jira_auth_fails_for_invalid_method(self):
     responses.add(responses.GET, 'http://jira.example.com/invalid_method',
                   body='{"error": "not found"}', status=404,
                   content_type='application/json')
     jira = Jira(CONFIG)
     with pytest.raises(requests.HTTPError):
         jira.make_request('invalid_method')
コード例 #2
0
 def test_jira_auth_fails_for_invalid_method(self):
     responses.add(responses.GET,
                   'http://jira.example.com/invalid_method',
                   body='{"error": "not found"}',
                   status=404,
                   content_type='application/json')
     jira = Jira(CONFIG)
     with pytest.raises(requests.HTTPError):
         jira.make_request('invalid_method')
コード例 #3
0
ファイル: test_jira.py プロジェクト: pawel-lewtak/economic-py
 def test_jira_auth_ok_for_basic_request(self):
     responses.add(responses.GET, 'http://jira.example.com/search',
                   body='{"startAt":0,"maxResults":50,"total":0,"issues":[]}', status=200,
                   content_type='application/json')
     jira = Jira(CONFIG)
     response = jira.make_request('search')
     assert 0 == response['total']
コード例 #4
0
 def test_jira_auth_ok_for_basic_request(self):
     responses.add(
         responses.GET,
         'http://jira.example.com/search',
         body='{"startAt":0,"maxResults":50,"total":0,"issues":[]}',
         status=200,
         content_type='application/json')
     jira = Jira(CONFIG)
     response = jira.make_request('search')
     assert 0 == response['total']