From 4aab4087dc97906d0b9890035401175cdaab32d4 Mon Sep 17 00:00:00 2001 From: blackhao <13851610112@163.com> Date: Fri, 22 Aug 2025 02:51:50 -0500 Subject: 2.0 --- .../jsonschema_specifications/tests/__init__.py | 0 .../tests/__pycache__/__init__.cpython-312.pyc | Bin 0 -> 208 bytes .../test_jsonschema_specifications.cpython-312.pyc | Bin 0 -> 1952 bytes .../tests/test_jsonschema_specifications.py | 41 +++++++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 .venv/lib/python3.12/site-packages/jsonschema_specifications/tests/__init__.py create mode 100644 .venv/lib/python3.12/site-packages/jsonschema_specifications/tests/__pycache__/__init__.cpython-312.pyc create mode 100644 .venv/lib/python3.12/site-packages/jsonschema_specifications/tests/__pycache__/test_jsonschema_specifications.cpython-312.pyc create mode 100644 .venv/lib/python3.12/site-packages/jsonschema_specifications/tests/test_jsonschema_specifications.py (limited to '.venv/lib/python3.12/site-packages/jsonschema_specifications/tests') diff --git a/.venv/lib/python3.12/site-packages/jsonschema_specifications/tests/__init__.py b/.venv/lib/python3.12/site-packages/jsonschema_specifications/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/.venv/lib/python3.12/site-packages/jsonschema_specifications/tests/__pycache__/__init__.cpython-312.pyc b/.venv/lib/python3.12/site-packages/jsonschema_specifications/tests/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..43aa478 Binary files /dev/null and b/.venv/lib/python3.12/site-packages/jsonschema_specifications/tests/__pycache__/__init__.cpython-312.pyc differ diff --git a/.venv/lib/python3.12/site-packages/jsonschema_specifications/tests/__pycache__/test_jsonschema_specifications.cpython-312.pyc b/.venv/lib/python3.12/site-packages/jsonschema_specifications/tests/__pycache__/test_jsonschema_specifications.cpython-312.pyc new file mode 100644 index 0000000..6f2c27f Binary files /dev/null and b/.venv/lib/python3.12/site-packages/jsonschema_specifications/tests/__pycache__/test_jsonschema_specifications.cpython-312.pyc differ diff --git a/.venv/lib/python3.12/site-packages/jsonschema_specifications/tests/test_jsonschema_specifications.py b/.venv/lib/python3.12/site-packages/jsonschema_specifications/tests/test_jsonschema_specifications.py new file mode 100644 index 0000000..fd2927e --- /dev/null +++ b/.venv/lib/python3.12/site-packages/jsonschema_specifications/tests/test_jsonschema_specifications.py @@ -0,0 +1,41 @@ +from collections.abc import Mapping +from pathlib import Path + +import pytest + +from jsonschema_specifications import REGISTRY + + +def test_it_contains_metaschemas(): + schema = REGISTRY.contents("http://json-schema.org/draft-07/schema#") + assert isinstance(schema, Mapping) + assert schema["$id"] == "http://json-schema.org/draft-07/schema#" + assert schema["title"] == "Core schema meta-schema" + + +def test_it_is_crawled(): + assert REGISTRY.crawl() == REGISTRY + + +@pytest.mark.parametrize( + "ignored_relative_path", + ["schemas/.DS_Store", "schemas/draft7/.DS_Store"], +) +def test_it_copes_with_dotfiles(ignored_relative_path): + """ + Ignore files like .DS_Store if someone has actually caused one to exist. + + We test here through the private interface as of course the global has + already loaded our schemas. + """ + + import jsonschema_specifications + + package = Path(jsonschema_specifications.__file__).parent + + ignored = package / ignored_relative_path + ignored.touch() + try: + list(jsonschema_specifications._schemas()) + finally: + ignored.unlink() -- cgit v1.2.3