File: test_annotations.py

package info (click to toggle)
python-check-jsonschema 0.34.1-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 3,796 kB
  • sloc: python: 5,529; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 771 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
import typing as t

import pytest

from check_jsonschema.cli import main as cli_main

click_type_test = pytest.importorskip(
    "click_type_test", reason="tests require 'click-type-test'"
)


def test_annotations_match_click_params():
    click_type_test.check_param_annotations(
        cli_main,
        overrides={
            # don't bother with a Literal for this, since it's relatively dynamic data
            "builtin_schema": str | None,
            # force default_filetype to be a Literal including `json5`, which is only
            # included in the choices if a parser is installed
            "default_filetype": t.Literal["json", "yaml", "toml", "json5"],
            "force_filetype": t.Literal["json", "yaml", "toml", "json5"] | None,
        },
    )