From 482319f0b0313fb9a96f4c5e28c7a8b5e643a562 Mon Sep 17 00:00:00 2001 From: Mike Bennett Date: Fri, 24 May 2024 00:15:14 +0100 Subject: [PATCH] Set cache disable env var in all test suites (#69) --- tests/test_basic.py | 4 ++++ tests/test_cantaloupe_resolver.py | 3 +++ tests/test_collections.py | 4 +++- tests/test_linking.py | 3 +++ tests/test_manifests.py | 3 +++ tests/test_manifests_v2.py | 3 +++ tests/test_resolver.py | 3 +++ tests/test_video.py | 3 +++ 8 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/test_basic.py b/tests/test_basic.py index e690f0a..0c40327 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -1,3 +1,6 @@ +import os +os.environ["FLASK_CACHE_DISABLE"] = "true" + import unittest from flask.testing import FlaskClient from iiify.app import app @@ -8,6 +11,7 @@ class TestBasic(unittest.TestCase): def setUp(self) -> None: self.test_app = FlaskClient(app) + def test_documentation(self): resp = self.test_app.get("/iiif/documentation") self.assertEqual(resp.status_code, 200) diff --git a/tests/test_cantaloupe_resolver.py b/tests/test_cantaloupe_resolver.py index 0d963f6..e24f6cf 100644 --- a/tests/test_cantaloupe_resolver.py +++ b/tests/test_cantaloupe_resolver.py @@ -1,3 +1,6 @@ +import os +os.environ["FLASK_CACHE_DISABLE"] = "true" + import unittest from iiify.resolver import cantaloupe_resolver diff --git a/tests/test_collections.py b/tests/test_collections.py index 23d79d9..a0c1667 100644 --- a/tests/test_collections.py +++ b/tests/test_collections.py @@ -1,7 +1,9 @@ +import os +os.environ["FLASK_ENV"] = "testing" + import unittest from flask.testing import FlaskClient from iiify.app import app - class TestCollections(unittest.TestCase): def setUp(self) -> None: diff --git a/tests/test_linking.py b/tests/test_linking.py index 20ffb65..edb326e 100644 --- a/tests/test_linking.py +++ b/tests/test_linking.py @@ -1,3 +1,6 @@ +import os +os.environ["FLASK_CACHE_DISABLE"] = "true" + import unittest from flask.testing import FlaskClient from iiify.app import app diff --git a/tests/test_manifests.py b/tests/test_manifests.py index 5bd5ee6..ce34c21 100644 --- a/tests/test_manifests.py +++ b/tests/test_manifests.py @@ -1,3 +1,6 @@ +import os +os.environ["FLASK_CACHE_DISABLE"] = "true" + import unittest from flask.testing import FlaskClient from iiify.app import app diff --git a/tests/test_manifests_v2.py b/tests/test_manifests_v2.py index 2380259..c1f241d 100644 --- a/tests/test_manifests_v2.py +++ b/tests/test_manifests_v2.py @@ -1,3 +1,6 @@ +import os +os.environ["FLASK_CACHE_DISABLE"] = "true" + import unittest from flask.testing import FlaskClient from iiify.app import app diff --git a/tests/test_resolver.py b/tests/test_resolver.py index fe01b99..b14f327 100644 --- a/tests/test_resolver.py +++ b/tests/test_resolver.py @@ -1,3 +1,6 @@ +import os +os.environ["FLASK_CACHE_DISABLE"] = "true" + import unittest from iiify.resolver import purify_domain, collection, manifest_page diff --git a/tests/test_video.py b/tests/test_video.py index 7644f81..117d14c 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -1,3 +1,6 @@ +import os +os.environ["FLASK_CACHE_DISABLE"] = "true" + import unittest from flask.testing import FlaskClient from iiify.app import app