Пример #1
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')
Пример #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
 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']