コード例 #1
0
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'
    )
コード例 #2
0
ファイル: test_client.py プロジェクト: nfarina/plaid-python
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'
    )
コード例 #3
0
ファイル: test_client.py プロジェクト: nfarina/plaid-python
def test_ResourceNotFound_categories():
    client = Client('test_id', 'test_secret')
    with pytest.raises(ResourceNotFoundError):
        client.category('pnc')
コード例 #4
0
ファイル: test_client.py プロジェクト: nfarina/plaid-python
def test_category():
    client = Client('test_id', 'test_secret')
    response = client.category(client.categories().json()[0]['id'])
    assert response.status_code == 200
コード例 #5
0
def test_category():
    with patch('requests.get') as mock_requests_get:
        client = Client('myclientid', 'mysecret')
        client.category(1)
        assert mock_requests_get.called
コード例 #6
0
def test_ResourceNotFound_categories():
    client = Client('test_id', 'test_secret')
    with pytest.raises(ResourceNotFoundError):
      client.category('pnc')
コード例 #7
0
def test_category():
    client = Client('test_id', 'test_secret')
    response = client.category(client.categories().json()[0]['id'])
    assert response.status_code == 200