about summary refs log tree commit diff
path: root/test/python
diff options
context:
space:
mode:
Diffstat (limited to 'test/python')
-rw-r--r--test/python/test_dataset_probeset_info.py21
-rw-r--r--test/python/test_dataset_probeset_values.py21
-rw-r--r--test/python/test_dataset_probesets.py19
-rw-r--r--test/python/test_traits.py19
4 files changed, 80 insertions, 0 deletions
diff --git a/test/python/test_dataset_probeset_info.py b/test/python/test_dataset_probeset_info.py
index 32d25a6..c073f3a 100644
--- a/test/python/test_dataset_probeset_info.py
+++ b/test/python/test_dataset_probeset_info.py
@@ -105,6 +105,27 @@ class DatasetProbesetInfoTest(ServerTestCase):
         error = json.loads(body)
         self.assertEqual(error["code"], "forbidden")
 
+    def test_dataset_probeset_info_recent_non_public_dataset_returns_403(self):
+        """Same as above, but with a dataset genuinely less than a year
+        old (UTHSC_BXD_Cochlea_0225 above is real but was already ~20
+        months old by the time this test was written) -- the age-embargo
+        rule and the "not yet linked to any gn-auth resource" deny path
+        both need to hold for freshly-added data, not just for something
+        that merely hasn't aged into public yet.
+        UTHSC_BXD_2wk_Cochlea_0926 (public=1, confidentiality=1, created
+        2026-09-01) is the most recently added ProbeSetFreeze in the
+        database as of this writing.
+        """
+        self.require_fixtures()
+
+        response, body = self.get(
+            "/datasets/UTHSC_BXD_2wk_Cochlea_0926/probesets/ENSMUSG00000028180"
+        )
+        self.assertEqual(response.status, 403)
+
+        error = json.loads(body)
+        self.assertEqual(error["code"], "forbidden")
+
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/test/python/test_dataset_probeset_values.py b/test/python/test_dataset_probeset_values.py
index 7a934d0..b11b5d6 100644
--- a/test/python/test_dataset_probeset_values.py
+++ b/test/python/test_dataset_probeset_values.py
@@ -109,6 +109,27 @@ class DatasetProbesetValuesTest(ServerTestCase):
         error = json.loads(body)
         self.assertEqual(error["code"], "forbidden")
 
+    def test_dataset_probeset_values_recent_non_public_dataset_returns_403(self):
+        """Same as above, but with a dataset genuinely less than a year
+        old (UTHSC_BXD_Cochlea_0225 above is real but was already ~20
+        months old by the time this test was written) -- the age-embargo
+        rule and the "not yet linked to any gn-auth resource" deny path
+        both need to hold for freshly-added data, not just for something
+        that merely hasn't aged into public yet.
+        UTHSC_BXD_2wk_Cochlea_0926 (public=1, confidentiality=1, created
+        2026-09-01) is the most recently added ProbeSetFreeze in the
+        database as of this writing.
+        """
+        self.require_fixtures()
+
+        response, body = self.get(
+            "/datasets/UTHSC_BXD_2wk_Cochlea_0926/probesets/ENSMUSG00000028180/values"
+        )
+        self.assertEqual(response.status, 403)
+
+        error = json.loads(body)
+        self.assertEqual(error["code"], "forbidden")
+
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/test/python/test_dataset_probesets.py b/test/python/test_dataset_probesets.py
index dcfcd99..c12b42a 100644
--- a/test/python/test_dataset_probesets.py
+++ b/test/python/test_dataset_probesets.py
@@ -89,6 +89,25 @@ class DatasetProbesetsTest(ServerTestCase):
         error = json.loads(body)
         self.assertEqual(error["code"], "forbidden")
 
+    def test_dataset_probesets_recent_non_public_dataset_returns_403(self):
+        """Same as above, but with a dataset genuinely less than a year
+        old (UTHSC_BXD_Cochlea_0225 above is real but was already ~20
+        months old by the time this test was written) -- the age-embargo
+        rule and the "not yet linked to any gn-auth resource" deny path
+        both need to hold for freshly-added data, not just for something
+        that merely hasn't aged into public yet.
+        UTHSC_BXD_2wk_Cochlea_0926 (public=1, confidentiality=1, created
+        2026-09-01) is the most recently added ProbeSetFreeze in the
+        database as of this writing.
+        """
+        self.require_fixtures()
+
+        response, body = self.get("/datasets/UTHSC_BXD_2wk_Cochlea_0926/probesets")
+        self.assertEqual(response.status, 403)
+
+        error = json.loads(body)
+        self.assertEqual(error["code"], "forbidden")
+
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/test/python/test_traits.py b/test/python/test_traits.py
index 38bf411..6a44bd8 100644
--- a/test/python/test_traits.py
+++ b/test/python/test_traits.py
@@ -176,6 +176,25 @@ class TraitsTest(ServerTestCase):
         error = json.loads(body)
         self.assertEqual(error["code"], "forbidden")
 
+    def test_trait_info_recent_non_public_probeset_dataset_returns_403(self):
+        """Same as above, but with a dataset genuinely less than a year
+        old (UTHSC_BXD_Cochlea_0225 above is real but was already ~20
+        months old by the time this test was written) -- the age-embargo
+        rule and the "not yet linked to any gn-auth resource" deny path
+        both need to hold for freshly-added data, not just for something
+        that merely hasn't aged into public yet.
+        UTHSC_BXD_2wk_Cochlea_0926 (public=1, confidentiality=1, created
+        2026-09-01) is the most recently added ProbeSetFreeze in the
+        database as of this writing.
+        """
+        self.require_fixtures()
+
+        response, body = self.get("/traits/UTHSC_BXD_2wk_Cochlea_0926/ENSMUSG00000028180")
+        self.assertEqual(response.status, 403)
+
+        error = json.loads(body)
+        self.assertEqual(error["code"], "forbidden")
+
 
 if __name__ == "__main__":
     unittest.main()