def test_ResourceNotFound_categories_with_suppressed_error(): Client.config({'suppress_http_errors': True}) client = Client('test_id', 'test_secret') response = client.category('pnc') assert response.status_code == 404 assert ( json.loads(response.content)['message'] == 'unable to find category' )
def test_ResourceNotFound_categories_with_suppressed_error(): Client.config({'suppress_http_errors': True}) client = Client('test_id', 'test_secret') response = client.category('pnc') assert response.status_code == 404 assert ( to_json(response)['message'] == 'unable to find category' )
def test_ResourceNotFound_categories(): client = Client('test_id', 'test_secret') with pytest.raises(ResourceNotFoundError): client.category('pnc')
def test_category(): client = Client('test_id', 'test_secret') response = client.category(client.categories().json()[0]['id']) assert response.status_code == 200
def test_category(): with patch('requests.get') as mock_requests_get: client = Client('myclientid', 'mysecret') client.category(1) assert mock_requests_get.called