From ef6cd42a46d7b9c9136954c271e0d2ec7312ce73 Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Thu, 4 Sep 2025 20:56:26 +0100 Subject: [PATCH] Test that https://unpkg.com is used only in the connected mode --- docs/changelog.md | 7 +++++++ src/itables/version.py | 2 +- tests/test_connected_notebook_is_small.py | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index 5c6a9323..948d2969 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,6 +1,13 @@ ITables ChangeLog ================= +2.5.3-dev (unreleased) +------------------ + +**Added** +- Added a test to check that the offline mode does not load ITables from https://unpkg.com (the connected mode does) ([#441](https://github.com/mwouts/itables/issues/441)) + + 2.5.2 (2025-09-02) ------------------ diff --git a/src/itables/version.py b/src/itables/version.py index 6dd5e73c..2624a8c5 100644 --- a/src/itables/version.py +++ b/src/itables/version.py @@ -1,3 +1,3 @@ """ITables' version number""" -__version__ = "2.5.2" +__version__ = "2.5.3dev" diff --git a/tests/test_connected_notebook_is_small.py b/tests/test_connected_notebook_is_small.py index 9969e57e..22b1cd96 100644 --- a/tests/test_connected_notebook_is_small.py +++ b/tests/test_connected_notebook_is_small.py @@ -32,6 +32,9 @@ def test_connected_notebook_is_small(tmp_path, display_logo_when_loading): f"Notebook size is too large: {nb_ipynb.stat().st_size} bytes:\n" f"{nb_ipynb.read_text()}" ) + assert ( + "https://unpkg.com" in nb_ipynb.read_text() + ), "The connected notebook should import itables from unpkg.com" def test_offline_notebook_is_not_too_large(tmp_path): @@ -43,3 +46,6 @@ def test_offline_notebook_is_not_too_large(tmp_path): size_in_kb = nb_ipynb.stat().st_size // 1024 assert 850 < size_in_kb < 950 + assert ( + "https://unpkg.com" not in nb_ipynb.read_text() + ), "The connected notebook should import itables locally"