diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index b59bdc2..18aa5b1 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -5,12 +5,12 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] + os: [ubuntu-20.04] python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v3.3.0 + - uses: actions/setup-python@v4.5.0 with: python-version: ${{ matrix.python }} - run: pip install --upgrade pip diff --git a/pylti1p3/contrib/django/lti1p3_tool_config/migrations/0001_initial.py b/pylti1p3/contrib/django/lti1p3_tool_config/migrations/0001_initial.py index 625e129..0b850b8 100644 --- a/pylti1p3/contrib/django/lti1p3_tool_config/migrations/0001_initial.py +++ b/pylti1p3/contrib/django/lti1p3_tool_config/migrations/0001_initial.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [] diff --git a/pylti1p3/deep_link_resource.py b/pylti1p3/deep_link_resource.py index 131606f..e3c2103 100644 --- a/pylti1p3/deep_link_resource.py +++ b/pylti1p3/deep_link_resource.py @@ -8,6 +8,7 @@ class DeepLinkResource: _url: t.Optional[str] = None _lineitem: t.Optional[LineItem] = None _custom_params: t.Mapping[str, str] = {} + _iframe: t.Mapping[str, int] = {} _target: str = "iframe" _icon_url: t.Optional[str] = None @@ -60,6 +61,13 @@ def set_icon_url(self, value: str) -> "DeepLinkResource": self._icon_url = value return self + def get_iframe(self) -> t.Mapping[str, int]: + return self._iframe + + def set_iframe(self, value: t.Mapping[str, int]): + self._iframe = value + return self + def to_dict(self) -> t.Dict[str, object]: res: t.Dict[str, object] = { "type": self._type, @@ -93,4 +101,7 @@ def to_dict(self) -> t.Dict[str, object]: if self._icon_url: res["icon"] = {"url": self._icon_url} + if self._iframe: + res["iframe"] = self._iframe + return res diff --git a/pylti1p3/deployment.py b/pylti1p3/deployment.py index cfbbf9b..2cceb94 100644 --- a/pylti1p3/deployment.py +++ b/pylti1p3/deployment.py @@ -2,7 +2,6 @@ class Deployment: - _deployment_id: t.Optional[str] = None def get_deployment_id(self) -> t.Optional[str]: diff --git a/tests/test_deep_link.py b/tests/test_deep_link.py index d9a3083..287fa6b 100644 --- a/tests/test_deep_link.py +++ b/tests/test_deep_link.py @@ -160,7 +160,7 @@ def test_deep_link_launch_success(self): resource = DeepLinkResource() resource.set_url("http://lti.django.test/launch/").set_custom_params( {"custom_param": "custom_value"} - ).set_title("Test title!") + ).set_title("Test title!").set_iframe({"width": 800, "height": 400}) deep_link_return_url = message_launch_data.get( "https://purl.imsglobal.org/spec/lti-dl/claim/deep_linking_settings" diff --git a/tests/test_resource_link.py b/tests/test_resource_link.py index cb669c4..85477fa 100644 --- a/tests/test_resource_link.py +++ b/tests/test_resource_link.py @@ -299,7 +299,6 @@ def _get_data_with_invalid_message(self, *args): # pylint: disable=unused-argum return message_launch_data def test_res_link_launch_invalid_nonce(self): - tool_conf, login_request, login_response = self._make_oidc_login() post_data = self.post_launch_data.copy() diff --git a/tox.ini b/tox.ini index 51058bd..e25a59d 100644 --- a/tox.ini +++ b/tox.ini @@ -20,7 +20,7 @@ deps = mypy parameterized pyjwt - pylint + pylint<2.15.6 requests requests-mock types-requests