-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 91c7c3c.
- Loading branch information
Showing
2 changed files
with
11 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,38 +3,23 @@ | |
import pytest | ||
import responses | ||
|
||
from tgtg import AUTH_POLLING_ENDPOINT, BASE_URL, SIGNUP_BY_EMAIL_ENDPOINT, TgtgClient | ||
from tgtg import BASE_URL, SIGNUP_BY_EMAIL_ENDPOINT, TgtgClient | ||
from tgtg.exceptions import TgtgAPIError | ||
|
||
|
||
def test_signup_ok(): | ||
responses.add( | ||
responses.POST, | ||
urljoin(BASE_URL, AUTH_POLLING_ENDPOINT), | ||
json={ | ||
"access_token": "an_access_token", | ||
"refresh_token": "a_refresh_token", | ||
"startup_data": {"user": {"user_id": 1234}}, | ||
}, | ||
status=200, | ||
adding_headers={"set-cookie": "sweet sweet cookie"}, | ||
) | ||
responses.add( | ||
responses.POST, | ||
urljoin(BASE_URL, AUTH_POLLING_ENDPOINT), | ||
status=202, | ||
) | ||
responses.add( | ||
responses.POST, | ||
urljoin(BASE_URL, SIGNUP_BY_EMAIL_ENDPOINT), | ||
json={ | ||
"state": "WAIT", | ||
"polling_id": "a_polling_id", | ||
"login_response": { | ||
"access_token": "an_access_token", | ||
"refresh_token": "a_refresh_token", | ||
} | ||
}, | ||
status=200, | ||
) | ||
client = TgtgClient() | ||
client.signup_by_email(email="[email protected]") | ||
client = TgtgClient().signup_by_email(email="[email protected]") | ||
assert client.access_token == "an_access_token" | ||
assert client.refresh_token == "a_refresh_token" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters