-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify JwtToken test by removing session configuration
- Loading branch information
gabino
committed
Jan 30, 2025
1 parent
c508ed0
commit 1a1d12e
Showing
1 changed file
with
3 additions
and
21 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 |
---|---|---|
@@ -1,28 +1,10 @@ | ||
import pytest | ||
|
||
from cuenca import JwtToken, LoginToken, UserLogin | ||
from cuenca.http.client import Session | ||
|
||
|
||
@pytest.fixture(scope='function') | ||
def session(): | ||
session = Session() | ||
session.configure( | ||
'api_key', | ||
'api_secret', | ||
sandbox=True, | ||
) | ||
return session | ||
from cuenca import JwtToken | ||
|
||
|
||
@pytest.mark.vcr | ||
def test_jwt_tokens(session): | ||
UserLogin.create('111111', session=session) | ||
login_token = LoginToken.create(session=session) | ||
session.headers.pop( | ||
'X-Cuenca-LoginId', | ||
) | ||
session.configure(login_token=login_token.id) | ||
jwt_token = JwtToken.create(session=session) | ||
def test_jwt_tokens(): | ||
jwt_token = JwtToken.create() | ||
assert jwt_token | ||
assert isinstance(jwt_token.token, str) |