How to use the pynubank.nubank.NuException function in pynubank

To help you get started, we’ve selected a few pynubank examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github andreroggeri / pynubank / tests / test_nubank_client.py View on Github external
def test_grapql_query_raises_exeption(monkeypatch, authentication_return):
    nubank_client = Nubank()

    response = create_fake_response({}, 401)

    monkeypatch.setattr('requests.post', MagicMock(return_value=response))
    with pytest.raises(NuException):
        nubank_client.get_account_balance()
github andreroggeri / pynubank / tests / test_nubank_client.py View on Github external
def test_authentication_with_qr_code_failure_raise_exception(monkeypatch):
    response = create_fake_response({}, 401)

    monkeypatch.setattr('requests.post', MagicMock(return_value=response))
    with pytest.raises(NuException):
        nu = Nubank()
        nu.authenticate_with_qr_code('12345678912', 'hunter12', 'some-uuid')
github andreroggeri / pynubank / pynubank / nubank.py View on Github external
def _handle_response(self, response: Response) -> dict:
        if response.status_code != 200:
            raise NuException(response.status_code, response.json(), response.url)

        return response.json()

pynubank

MIT
Latest version published 1 year ago

Package Health Score

50 / 100
Full package analysis