mirror of
https://github.com/thegeeklab/corenetworks.git
synced 2024-11-22 07:20:39 +00:00
fix testing
This commit is contained in:
parent
7a0d9c0a32
commit
4b563288fc
@ -7,7 +7,10 @@ from corenetworks.authenticators import CoreNetworksTokenAuth
|
|||||||
def test_basic_auth(requests_mock):
|
def test_basic_auth(requests_mock):
|
||||||
requests_mock.post(
|
requests_mock.post(
|
||||||
"https://beta.api.core-networks.de/auth/token",
|
"https://beta.api.core-networks.de/auth/token",
|
||||||
json={"token": "mytoken"},
|
json={
|
||||||
|
"token": "mytoken",
|
||||||
|
"expires": 3600
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
auth = CoreNetworksBasicAuth(
|
auth = CoreNetworksBasicAuth(
|
||||||
|
@ -17,7 +17,7 @@ from corenetworks.test.fixtures.callback import records_post_callback
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def client(mocker):
|
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")
|
client = CoreNetworks(user="testuser", password="testpass")
|
||||||
|
|
||||||
return client
|
return client
|
||||||
|
Loading…
Reference in New Issue
Block a user