summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adams <mark@markadams.me>2015-04-14 11:42:29 -0500
committerMark Adams <madams@atlassian.com>2015-04-14 11:42:29 -0500
commite3cba6c94774378de05b231be6dbebc76e476f28 (patch)
tree7a6ca2e2f0914c7f1a96c7c7f239455a87d2666c
parent5b517f525a8ea0fd5b86425ee234fdc7108eb5ab (diff)
downloadpyjwt-e3cba6c94774378de05b231be6dbebc76e476f28.tar.gz
Fixed some squirly looking tests.
-rw-r--r--tests/test_api.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index 648d333..9f611d5 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -79,23 +79,19 @@ class TestAPI:
assert 'none' not in jwt.get_algorithms()
assert 'HS256' in jwt.get_algorithms()
- def test_override_options(self, jwt):
- # TODO: Does this test make sense?
+ def test_override_options(self):
jwt = PyJWT(options={'verify_exp': False, 'verify_nbf': False})
expected_options = jwt.options
- expected_options['verify_exp'] = False
- expected_options['verify_nbf'] = False
- assert expected_options == jwt.options
+ assert not jwt.options['verify_exp']
+ assert not jwt.options['verify_nbf']
- def test_non_object_options_persist(self):
- # TODO: Does this test make sense
- jwt = PyJWT(options={'verify_iat': False, 'foobar': False})
- expected_options = jwt.options
+ def test_non_object_options_dont_persist(self, jwt):
+ token = jwt.encode({'hello': 'world'}, 'secret')
+
+ jwt.decode(token, 'secret', options={'verify_iat': False})
- expected_options['verify_iat'] = False
- expected_options['foobar'] = False
- assert expected_options == jwt.options
+ assert jwt.options['verify_iat']
def test_options_must_be_dict(self, jwt):
pytest.raises(TypeError, PyJWT, options=object())