From 4b563288fc9c67ef67c290dcf66919bb030863bc Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 12 May 2020 14:25:16 +0200 Subject: [PATCH] fix testing --- corenetworks/test/unit/test_authenticators.py | 5 ++++- corenetworks/test/unit/test_client.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/corenetworks/test/unit/test_authenticators.py b/corenetworks/test/unit/test_authenticators.py index aa05685..bed5b64 100644 --- a/corenetworks/test/unit/test_authenticators.py +++ b/corenetworks/test/unit/test_authenticators.py @@ -7,7 +7,10 @@ from corenetworks.authenticators import CoreNetworksTokenAuth def test_basic_auth(requests_mock): requests_mock.post( "https://beta.api.core-networks.de/auth/token", - json={"token": "mytoken"}, + json={ + "token": "mytoken", + "expires": 3600 + }, ) auth = CoreNetworksBasicAuth( diff --git a/corenetworks/test/unit/test_client.py b/corenetworks/test/unit/test_client.py index 4efb00e..043f58b 100644 --- a/corenetworks/test/unit/test_client.py +++ b/corenetworks/test/unit/test_client.py @@ -17,7 +17,7 @@ from corenetworks.test.fixtures.callback import records_post_callback @pytest.fixture def client(mocker): - mocker.patch.object(CoreNetworksBasicAuth, "_login", return_value="testtoken") + mocker.patch.object(CoreNetworksBasicAuth, "_login", return_value=("testtoken", 3600)) client = CoreNetworks(user="testuser", password="testpass") return client