File: test_draft2019.py

package info (click to toggle)
python-fastjsonschema 2.21.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,780 kB
  • sloc: python: 3,343; makefile: 88; sh: 18
file content (59 lines) | stat: -rw-r--r-- 1,759 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import pytest

from .utils import template_test, resolve_param_values_and_ids


def pytest_generate_tests(metafunc):
    param_values, param_ids = resolve_param_values_and_ids(
        schema_version='http://json-schema.org/draft-2019-09/schema',
        suite_dir='JSON-Schema-Test-Suite/tests/draft2019-09',
        ignored_suite_files=[
            'refRemote.json', # Requires local server.
            # Optional.
            'ecmascript-regex.json',
            'float-overflow.json',
            'idn-hostname.json',
            'iri.json',
            'unknown.json',
            'unknownKeyword.json',
            'date-time.json',
            'date.json',

            # TODO: fix const with booleans to not match numbers
            'const.json',
            'enum.json',

            # TODO: fix formats
            'ipv6.json',
            'time.json',

            # TODO: fix ref
            'ref.json',
            'id.json',
            'cross-draft.json',

            # TODO: fix definitions
            'definitions.json',

            # TODO: new stuff, not implemented yet
            'not.json',
            'anchor.json',
            'content.json',
            'defs.json',
            'dependentRequired.json',
            'dependentSchemas.json',
            'maxContains.json',
            'minContains.json',
            'duration.json',
            'uuid.json',
            'recursiveRef.json',
            'unevaluatedItems.json',
            'unevaluatedProperties.json',
            'vocabulary.json',
        ],
    )
    metafunc.parametrize(['schema_version', 'schema', 'data', 'is_valid'], param_values, ids=param_ids)


# Real test function to be used with parametrization by previous hook function.
test = template_test