From cd71b356e693b36aedc148d37869c3c3217178d5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 20:28:30 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- examples/jupyterhub_config_lti11.py | 1 + examples/jupyterhub_config_lti13.py | 1 + tests/lti13/stash_of_unused_fixtures.py | 1 + tests/lti13/test_lti13_authenticator.py | 1 + tests/lti13/test_lti13_validator.py | 12 ++++++------ 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/jupyterhub_config_lti11.py b/examples/jupyterhub_config_lti11.py index 68f9e9b..3aecf02 100644 --- a/examples/jupyterhub_config_lti11.py +++ b/examples/jupyterhub_config_lti11.py @@ -1,4 +1,5 @@ """ Example JupyterHub configuration file with LTI 1.1 settings. """ + import os # Set port and IP diff --git a/examples/jupyterhub_config_lti13.py b/examples/jupyterhub_config_lti13.py index e4380cf..87ddd4f 100644 --- a/examples/jupyterhub_config_lti13.py +++ b/examples/jupyterhub_config_lti13.py @@ -1,4 +1,5 @@ """ Example JupyterHub configuration file with LTI 1.3 settings. """ + import os # Set port and IP diff --git a/tests/lti13/stash_of_unused_fixtures.py b/tests/lti13/stash_of_unused_fixtures.py index aa11977..b8e71af 100644 --- a/tests/lti13/stash_of_unused_fixtures.py +++ b/tests/lti13/stash_of_unused_fixtures.py @@ -2,6 +2,7 @@ These fixtures are not used but kept as they may be relevant to use in the future. """ + from typing import Any, Callable, Dict import jwt diff --git a/tests/lti13/test_lti13_authenticator.py b/tests/lti13/test_lti13_authenticator.py index 7988ac0..d3f2f2a 100644 --- a/tests/lti13/test_lti13_authenticator.py +++ b/tests/lti13/test_lti13_authenticator.py @@ -5,6 +5,7 @@ We have dedicated tests of LTI13LaunchValidator's methods in test_lti13_validator.py. """ + from unittest.mock import patch import pytest diff --git a/tests/lti13/test_lti13_validator.py b/tests/lti13/test_lti13_validator.py index 7c06bcc..0abb0aa 100644 --- a/tests/lti13/test_lti13_validator.py +++ b/tests/lti13/test_lti13_validator.py @@ -181,9 +181,9 @@ def test_validate_launch_request_empty_roles(launch_req_jwt_decoded): def test_validate_launch_request_invalid_message_type(launch_req_jwt_decoded): validator = LTI13LaunchValidator() - launch_req_jwt_decoded[ - "https://purl.imsglobal.org/spec/lti/claim/message_type" - ] = "???" + launch_req_jwt_decoded["https://purl.imsglobal.org/spec/lti/claim/message_type"] = ( + "???" + ) with pytest.raises(IncorrectValueError): validator.validate_id_token(launch_req_jwt_decoded) @@ -191,9 +191,9 @@ def test_validate_launch_request_invalid_message_type(launch_req_jwt_decoded): def test_validate_launch_request_invalid_version(launch_req_jwt_decoded): validator = LTI13LaunchValidator() - launch_req_jwt_decoded[ - "https://purl.imsglobal.org/spec/lti/claim/version" - ] = "1.0.0" + launch_req_jwt_decoded["https://purl.imsglobal.org/spec/lti/claim/version"] = ( + "1.0.0" + ) with pytest.raises(IncorrectValueError): validator.validate_id_token(launch_req_jwt_decoded)