Skip to content

Commit b932061

Browse files
committed
fix:lint
1 parent 6098e00 commit b932061

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

integration/test_auth.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -655,14 +655,15 @@ def test_verify_session_cookie_revoked(new_user, api_key):
655655

656656
def test_verify_session_cookie_tolerance(new_user, api_key):
657657
expired_session_cookie = auth.create_session_cookie(
658-
_sign_in(auth.create_custom_token(new_user.uid), api_key),
658+
_sign_in(auth.create_custom_token(new_user.uid), api_key),
659659
expires_in=datetime.timedelta(seconds=3)
660660
)
661661
time.sleep(3)
662662
# Verify the session cookie with a tolerance of 0 seconds. This should
663663
# raise an exception because the cookie is expired.
664664
with pytest.raises(auth.InvalidSessionCookieError) as excinfo:
665-
auth.verify_session_cookie(expired_session_cookie, check_revoked=False, clock_skew_seconds=0)
665+
auth.verify_session_cookie(expired_session_cookie, check_revoked=False,
666+
clock_skew_seconds=0)
666667
assert str(excinfo.value) == 'The Firebase session cookie is expired.'
667668

668669
# Verify the session cookie with a tolerance of 2 seconds. This should
@@ -671,22 +672,24 @@ def test_verify_session_cookie_tolerance(new_user, api_key):
671672

672673
def test_verify_session_cookie_clock_skew_seconds_range(new_user, api_key):
673674
expired_session_cookie = auth.create_session_cookie(
674-
_sign_in(auth.create_custom_token(new_user.uid), api_key),
675+
_sign_in(auth.create_custom_token(new_user.uid), api_key),
675676
expires_in=datetime.timedelta(seconds=3)
676677
)
677678
# Verify the session cookie with a tolerance of 0 seconds. This should
678679
# raise an exception because the cookie is expired.
679680
with pytest.raises(ValueError) as excinfo:
680-
auth.verify_session_cookie(expired_session_cookie, check_revoked=False, clock_skew_seconds=-1)
681+
auth.verify_session_cookie(
682+
expired_session_cookie, check_revoked=False, clock_skew_seconds=-1)
681683
assert str(excinfo.value) == 'clock_skew_seconds must be between 0 and 60.'
682684
with pytest.raises(ValueError) as excinfo:
683-
auth.verify_session_cookie(expired_session_cookie, check_revoked=False, clock_skew_seconds=61)
685+
auth.verify_session_cookie(
686+
expired_session_cookie, check_revoked=False, clock_skew_seconds=61)
684687
assert str(excinfo.value) == 'clock_skew_seconds must be between 0 and 60.'
685688

686689
# Verify the session cookie with a tolerance of 2 seconds. This should
687690
# not raise an exception because the cookie is within the tolerance.
688691
auth.verify_session_cookie(expired_session_cookie, check_revoked=False, clock_skew_seconds=2)
689-
692+
690693

691694
def test_verify_session_cookie_disabled(new_user, api_key):
692695
custom_token = auth.create_custom_token(new_user.uid)

tests/test_token_gen.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -559,19 +559,19 @@ def test_expired_token(self, user_mgt_app):
559559
assert 'Token expired' in str(excinfo.value)
560560
assert excinfo.value.cause is not None
561561
assert excinfo.value.http_response is None
562-
562+
563563
def test_expired_token_with_tolerance(self, user_mgt_app):
564564
_overwrite_cert_request(user_mgt_app, MOCK_REQUEST)
565565
id_token = self.invalid_tokens['ExpiredTokenShort']
566566
if _is_emulated():
567567
self._assert_valid_token(id_token, user_mgt_app)
568568
return
569-
claims = auth.verify_id_token(id_token, app=user_mgt_app,
569+
claims = auth.verify_id_token(id_token, app=user_mgt_app,
570570
clock_skew_seconds=60)
571571
assert claims['admin'] is True
572572
assert claims['uid'] == claims['sub']
573-
with pytest.raises(auth.ExpiredIdTokenError) as excinfo:
574-
auth.verify_id_token(id_token, app=user_mgt_app,
573+
with pytest.raises(auth.ExpiredIdTokenError):
574+
auth.verify_id_token(id_token, app=user_mgt_app,
575575
clock_skew_seconds=20)
576576

577577
def test_project_id_option(self):
@@ -749,7 +749,7 @@ def test_expired_cookie_with_tolerance(self, user_mgt_app):
749749
clock_skew_seconds=59)
750750
assert claims['admin'] is True
751751
assert claims['uid'] == claims['sub']
752-
with pytest.raises(auth.ExpiredSessionCookieError) as excinfo:
752+
with pytest.raises(auth.ExpiredSessionCookieError):
753753
auth.verify_session_cookie(cookie, app=user_mgt_app, check_revoked=False,
754754
clock_skew_seconds=29)
755755

0 commit comments

Comments
 (0)