def test_algorithms_parameter_removes_alg_from_algorithms_list(self, jwt): assert 'none' in jwt.get_algorithms() assert 'HS256' in jwt.get_algorithms() jwt = PyJWT(algorithms=['HS256']) assert 'none' not in jwt.get_algorithms() assert 'HS256' in jwt.get_algorithms()
def test_ecdsa_related_algorithms(self, jwt): jwt = PyJWT() jwt_algorithms = jwt.get_algorithms() if has_crypto: assert 'ES256' in jwt_algorithms assert 'ES384' in jwt_algorithms assert 'ES512' in jwt_algorithms else: assert 'ES256' not in jwt_algorithms assert 'ES384' not in jwt_algorithms assert 'ES512' not in jwt_algorithms
def test_override_options(self): jwt = PyJWT(options={'verify_exp': False, 'verify_nbf': False}) assert not jwt.options['verify_exp'] assert not jwt.options['verify_nbf']
def jwt(): return PyJWT()