Skip to content

Commit e3cba6c

Browse files
committed
Fixed some squirly looking tests.
1 parent 5b517f5 commit e3cba6c

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

tests/test_api.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,19 @@ def test_algorithms_parameter_removes_alg_from_algorithms_list(self, jwt):
7979
assert 'none' not in jwt.get_algorithms()
8080
assert 'HS256' in jwt.get_algorithms()
8181

82-
def test_override_options(self, jwt):
83-
# TODO: Does this test make sense?
82+
def test_override_options(self):
8483
jwt = PyJWT(options={'verify_exp': False, 'verify_nbf': False})
8584
expected_options = jwt.options
8685

87-
expected_options['verify_exp'] = False
88-
expected_options['verify_nbf'] = False
89-
assert expected_options == jwt.options
86+
assert not jwt.options['verify_exp']
87+
assert not jwt.options['verify_nbf']
9088

91-
def test_non_object_options_persist(self):
92-
# TODO: Does this test make sense
93-
jwt = PyJWT(options={'verify_iat': False, 'foobar': False})
94-
expected_options = jwt.options
89+
def test_non_object_options_dont_persist(self, jwt):
90+
token = jwt.encode({'hello': 'world'}, 'secret')
91+
92+
jwt.decode(token, 'secret', options={'verify_iat': False})
9593

96-
expected_options['verify_iat'] = False
97-
expected_options['foobar'] = False
98-
assert expected_options == jwt.options
94+
assert jwt.options['verify_iat']
9995

10096
def test_options_must_be_dict(self, jwt):
10197
pytest.raises(TypeError, PyJWT, options=object())

0 commit comments

Comments
 (0)