AnonSec Shell
Server IP : 92.204.138.22  /  Your IP : 18.117.229.16
Web Server : Apache
System : Linux ns1009439.ip-92-204-138.us 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64
User : internationaljou ( 1019)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/opt/nydus/ops/jsonschema_specifications/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /var/opt/nydus/ops/jsonschema_specifications/tests//test_jsonschema_specifications.py
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()

Anon7 - 2022
AnonSec Team