From 37648dde2eb5f35bffa16ff3a125e6f79a1093ba Mon Sep 17 00:00:00 2001 From: Satoru SATOH Date: Sun, 12 May 2024 15:11:51 +0900 Subject: [PATCH] fix/change: migrate test cases from unittest.TestCase to pytest based with new test data loader (#173) * enhancement: add a badge for Azure Pipelines * enhancemnt: add new simple test data loader to be used with pytest.mark.parametrize - tests/common/__init__.py: Export some constants and functions added. - tests/common/test_tdc.py: Add test cases for new ones mentioned. * fix/change: migrate test cases from unittest based to pytest based with new test data loader * change: export RESOURCE_DIR and collect_for from tests.common to re-use them * fix: dce in tests.dicts.common * fix: lint fixes * refactor: simplify the code to collect test data and test cases * change: remove test data not used anymore --- README.rst | 4 + pkg/header.rst | 4 + src/anyconfig/query/__init__.py | 4 +- tests/api/dump/common.py | 14 - tests/api/dump/test_basics.py | 88 ++-- tests/api/dumps/common.py | 14 - tests/api/dumps/test_basics.py | 60 ++- tests/api/load/common.py | 27 +- .../load/multi_load/__init__.py} | 0 tests/api/load/multi_load/common.py | 13 + tests/api/load/multi_load/test_basics.py | 105 ++++ tests/api/load/multi_load/test_multi_types.py | 35 ++ tests/api/load/multi_load/test_query.py | 53 +++ tests/api/load/multi_load/test_schema.py | 72 +++ tests/api/load/multi_load/test_template.py | 43 ++ .../load/single_load/__init__.py} | 0 tests/api/load/single_load/test_ac_parser.py | 32 ++ tests/api/load/single_load/test_basics.py | 104 ++++ .../api/load/single_load/test_multi_types.py | 34 ++ tests/api/load/single_load/test_primitives.py | 32 ++ tests/api/load/single_load/test_query.py | 53 +++ tests/api/load/single_load/test_schema.py | 85 ++++ tests/api/load/single_load/test_template.py | 52 ++ tests/api/load/single_load/test_toml.py | 31 ++ tests/api/load/single_load/test_yaml.py | 31 ++ tests/api/load/test_basics.py | 19 - tests/api/load/test_multi_types.py | 19 - tests/api/load/test_query.py | 19 - tests/api/load/test_schema.py | 19 - tests/api/load/test_templates.py | 19 - tests/api/loads/common.py | 17 - tests/api/loads/test_basics.py | 90 ++-- tests/api/loads/test_query.py | 62 ++- tests/api/loads/test_schema.py | 78 +-- tests/api/loads/test_template.py | 64 ++- tests/api/multi_load/collector.py | 45 -- tests/api/multi_load/common.py | 48 +- tests/api/multi_load/datatypes.py | 25 - tests/api/multi_load/test_basics.py | 140 ++++-- tests/api/multi_load/test_collector.py | 54 --- tests/api/multi_load/test_common.py | 26 - tests/api/multi_load/test_multi_types.py | 34 +- tests/api/multi_load/test_query.py | 64 ++- tests/api/multi_load/test_schema.py | 84 ++-- tests/api/multi_load/test_template.py | 62 +-- tests/api/multi_load/test_utils.py | 94 ---- tests/api/multi_load/utils.py | 75 --- tests/api/open/common.py | 14 - tests/api/open/test_basics.py | 56 ++- tests/api/single_load/common.py | 41 -- tests/api/single_load/constants.py | 11 + tests/api/single_load/test_ac_parser.py | 33 +- tests/api/single_load/test_basics.py | 156 +++--- tests/api/single_load/test_common.py | 33 -- tests/api/single_load/test_multi_types.py | 35 +- tests/api/single_load/test_optional_types.py | 29 -- tests/api/single_load/test_primitives.py | 32 +- tests/api/single_load/test_query.py | 96 ++-- tests/api/single_load/test_schema.py | 116 +++-- tests/api/single_load/test_template.py | 101 ++-- tests/api/single_load/test_toml.py | 32 ++ tests/api/single_load/test_yaml.py | 32 ++ tests/api/test_utils.py | 37 +- tests/backend/base/test_parsers.py | 41 +- tests/backend/base/test_utils.py | 56 +-- tests/base/test_collector.py | 31 +- tests/base/test_utils.py | 210 ++++---- tests/cli/collectors.py | 122 ----- tests/cli/common.py | 82 ++++ tests/cli/datatypes.py | 30 +- tests/cli/test_base.py | 121 ----- tests/cli/test_detectors.py | 190 ++++---- tests/cli/test_errors.py | 45 +- tests/cli/test_extra_options.py | 51 +- tests/cli/test_ignore_missing.py | 48 +- tests/cli/test_multi_inputs.py | 48 +- tests/cli/test_parse_args.py | 43 +- tests/cli/test_query.py | 52 +- tests/cli/test_schema.py | 70 +-- tests/cli/test_schema_errors.py | 50 ++ tests/cli/test_show.py | 53 ++- tests/cli/test_single_input.py | 54 ++- tests/cli/test_single_input_to_yaml_output.py | 57 ++- tests/cli/test_template.py | 55 ++- tests/common/__init__.py | 14 + tests/common/paths.py | 11 +- tests/common/tdc.py | 81 ++++ tests/common/test_tdc.py | 138 ++++++ tests/dicts/common.py | 20 - tests/dicts/test_functions.py | 7 +- tests/dicts/test_get.py | 36 +- tests/dicts/test_merge.py | 57 ++- tests/dicts/test_mk_nested_dic.py | 32 +- tests/ioinfo/constants.py | 4 +- tests/ioinfo/test_detectors.py | 140 +++--- tests/ioinfo/test_factory.py | 45 +- tests/ioinfo/test_utils.py | 21 +- tests/parser/common.py | 20 - tests/parser/test_attrlist.py | 36 +- tests/parser/test_attrlist_0.py | 36 +- tests/parser/test_list.py | 36 +- tests/parser/test_parse.py | 36 +- tests/parser/test_single.py | 31 +- tests/parsers/test_parsers.py | 88 ++-- tests/parsers/test_utils.py | 115 +++-- tests/processors/test_processors.py | 66 +-- tests/processors/test_utils.py | 447 ++++++++++-------- tests/query/test_query.py | 63 +-- tests/requirements.d/test.txt | 1 + tests/res/1/api/dump | 1 + tests/res/1/api/dumps/basics/10/00.json | 1 + tests/res/1/api/dumps/basics/10/10.json | 1 + tests/res/1/api/dumps/basics/10/20.json | 1 + .../{dump => 1/api/dumps}/basics/10/e/00.txt | 0 .../{dump => 1/api/dumps}/basics/10/e/10.txt | 0 .../{dump => 1/api/dumps}/basics/10/e/20.txt | 0 .../res/{ => 1/api}/dumps/basics/10/o/00.json | 0 .../20 => 1/api/dumps/basics/10/o}/10.json | 0 .../20 => 1/api/dumps/basics/10/o}/20.json | 0 tests/res/1/api/dumps/basics/20/00.json | 1 + tests/res/1/api/dumps/basics/20/10.json | 1 + tests/res/1/api/dumps/basics/20/20.json | 1 + .../{dump => 1/api/dumps}/basics/20/e/00.txt | 0 .../{dump => 1/api/dumps}/basics/20/e/10.txt | 0 .../{dump => 1/api/dumps}/basics/20/e/20.txt | 0 .../res/{ => 1/api}/dumps/basics/20/o/00.json | 0 .../10 => 1/api/dumps/basics/20}/o/10.json | 0 .../10 => 1/api/dumps/basics/20}/o/20.json | 0 .../res/{load/multi => 1/api/load/multi_load} | 0 .../{load/single => 1/api/load/single_load} | 0 tests/res/1/api/loads/basics/10/00.txt | 1 + tests/res/1/api/loads/basics/10/10.txt | 1 + tests/res/1/api/loads/basics/10/20.txt | 1 + .../res/{ => 1/api}/loads/basics/10/e/00.json | 0 .../res/{ => 1/api}/loads/basics/10/e/10.json | 0 .../res/{ => 1/api}/loads/basics/10/e/20.json | 0 .../res/{ => 1/api}/loads/basics/10/o/00.json | 0 .../20 => 1/api/loads/basics/10}/o/10.json | 0 .../20 => 1/api/loads/basics/10}/o/20.json | 0 tests/res/1/api/loads/query/10/00_00.txt | 1 + tests/res/1/api/loads/query/10/00_10.txt | 1 + tests/res/1/api/loads/query/10/10_00.txt | 1 + tests/res/1/api/loads/query/10/10_10.txt | 1 + tests/res/1/api/loads/query/10/10_20.txt | 1 + tests/res/1/api/loads/query/10/10_30.txt | 1 + tests/res/1/api/loads/query/10/10_40.txt | 1 + tests/res/1/api/loads/query/10/10_50.txt | 1 + tests/res/1/api/loads/query/10/20_00.txt | 1 + tests/res/1/api/loads/query/10/20_10.txt | 1 + tests/res/1/api/loads/query/10/20_20.txt | 1 + tests/res/1/api/loads/query/10/e | 1 + .../{ => 1/api}/loads/query/10/o/00_00.json | 0 .../{ => 1/api}/loads/query/10/o/00_10.json | 0 .../e => 1/api/loads/query/10/o}/10_00.json | 0 .../{ => 1/api}/loads/query/10/o/10_10.json | 0 .../{ => 1/api}/loads/query/10/o/10_20.json | 0 .../{ => 1/api}/loads/query/10/o/10_30.json | 0 .../{ => 1/api}/loads/query/10/o/10_40.json | 0 .../api/loads/query/10/o/10_50.json} | 0 .../{ => 1/api}/loads/query/10/o/20_00.json | 0 .../{ => 1/api}/loads/query/10/o/20_10.json | 0 .../{ => 1/api}/loads/query/10/o/20_20.json | 0 tests/res/1/api/loads/query/10/q | 1 + tests/res/1/api/loads/schema/10/00.txt | 1 + tests/res/1/api/loads/schema/10/10.txt | 1 + tests/res/1/api/loads/schema/10/20.txt | 1 + tests/res/{ => 1/api}/loads/schema/10/e | 0 tests/res/{ => 1/api}/loads/schema/10/o | 0 tests/res/1/api/loads/schema/10/s/00.txt | 1 + tests/res/1/api/loads/schema/10/s/10.txt | 1 + tests/res/1/api/loads/schema/10/s/20.txt | 1 + tests/res/1/api/loads/template/10/00.txt | 1 + tests/res/1/api/loads/template/10/10.txt | 1 + tests/res/1/api/loads/template/10/20.txt | 1 + tests/res/1/api/loads/template/10/30.txt | 1 + tests/res/1/api/loads/template/10/c | 1 + tests/res/1/api/loads/template/10/e | 1 + .../{ => 1/api}/loads/template/10/o/00.json | 0 .../api/loads/template}/10/o/10.json | 0 .../api/loads/template}/10/o/20.json | 0 .../20 => 1/api/loads/template/10/o}/30.json | 0 .../api/multi_load/basics/00}/00.json | 0 .../{ => 1/api}/multi_load/basics/00/10.json | 0 .../{ => 1/api}/multi_load/basics/00/20.json | 0 .../{ => 1/api}/multi_load/basics/00/30.json | 0 .../{ => 1/api}/multi_load/basics/00/40.json | 0 .../api/multi_load/basics/00/e/00.json} | 0 .../api/multi_load/basics/00}/o/00.json | 0 .../api/multi_load/basics}/00/s/00.json | 0 .../{ => 1/api}/multi_load/basics/10/00.json | 0 .../{ => 1/api}/multi_load/basics/10/10.json | 0 .../{ => 1/api}/multi_load/basics/10/20.json | 0 .../{ => 1/api}/multi_load/basics/10/30.json | 0 .../{ => 1/api}/multi_load/basics/10/40.json | 0 .../{ => 1/api}/multi_load/basics/10/50.json | 0 tests/res/{ => 1/api}/multi_load/basics/10/e | 0 .../api}/multi_load/basics/10/o/00.json | 0 .../{ => 1/api}/multi_load/basics/20/00.json | 0 .../{ => 1/api}/multi_load/basics/20/10.json | 0 .../{ => 1/api}/multi_load/basics/20/20.json | 0 .../{ => 1/api}/multi_load/basics/20/30.json | 0 .../{ => 1/api}/multi_load/basics/20/40.json | 0 .../{ => 1/api}/multi_load/basics/20/50.json | 0 .../api/multi_load/basics/20/e/00.json} | 0 .../api}/multi_load/basics/20/o/00.json | 0 .../{ => 1/api}/multi_load/basics/30/00.json | 0 .../{ => 1/api}/multi_load/basics/30/10.json | 0 .../{ => 1/api}/multi_load/basics/30/20.json | 0 .../{ => 1/api}/multi_load/basics/30/30.json | 0 .../{ => 1/api}/multi_load/basics/30/40.json | 0 .../{ => 1/api}/multi_load/basics/30/50.json | 0 .../api/multi_load/basics/30/e/00.json} | 0 .../api}/multi_load/basics/30/o/00.json | 0 .../api}/multi_load/multi_types/10/00.json | 0 .../api}/multi_load/multi_types/10/10.ini | 0 .../api}/multi_load/multi_types/10/20.json | 0 .../api}/multi_load/multi_types/10/30.json | 0 .../multi_load/multi_types/10/40.properties | 0 .../api}/multi_load/multi_types/10/50.sh | 0 .../api/multi_load/multi_types/10/e/00.json} | 0 .../api/multi_load/multi_types/10}/o/00.json | 0 .../api}/multi_load/query/00_00/00.json | 0 .../api}/multi_load/query/00_00/10.json | 0 .../api}/multi_load/query/00_00/20.json | 0 .../api}/multi_load/query/00_00/30.json | 0 .../api}/multi_load/query/00_00/40.json | 0 .../api/multi_load/query/00_00/e/00.json} | 0 .../api/multi_load/query/00_00}/o/00.json | 0 .../api/multi_load/query/00_00/q/00.txt} | 0 .../api}/multi_load/query/00_10/00.json | 0 .../api}/multi_load/query/00_10/10.json | 0 .../api}/multi_load/query/00_10/20.json | 0 .../api}/multi_load/query/00_10/30.json | 0 .../api}/multi_load/query/00_10/40.json | 0 .../api/multi_load/query/00_10/e/00.json} | 0 .../api/multi_load/query/00_10}/o/00.json | 0 .../api/multi_load/query/00_10/q/00.txt} | 0 .../api}/multi_load/query/10_10/00.json | 0 .../api}/multi_load/query/10_10/10.json | 0 .../api}/multi_load/query/10_10/20.json | 0 .../api}/multi_load/query/10_10/30.json | 0 .../api}/multi_load/query/10_10/40.json | 0 .../api/multi_load/query/10_10/e/00.json} | 0 .../api/multi_load/query/10_10}/o/00.json | 0 .../api/multi_load/query/10_10/q/00.txt} | 0 .../api}/multi_load/query/10_20/00.json | 0 .../api}/multi_load/query/10_20/10.json | 0 .../api}/multi_load/query/10_20/20.json | 0 .../api}/multi_load/query/10_20/30.json | 0 .../api}/multi_load/query/10_20/40.json | 0 .../api/multi_load/query/10_20/e/00.json} | 0 .../api/multi_load/query/10_20}/o/00.json | 0 .../api/multi_load/query/10_20/q/00.txt} | 0 .../api}/multi_load/query/10_30/00.json | 0 .../api}/multi_load/query/10_30/10.json | 0 .../api}/multi_load/query/10_30/20.json | 0 .../api}/multi_load/query/10_30/30.json | 0 .../api}/multi_load/query/10_30/40.json | 0 .../api/multi_load/query/10_30/e/00.json} | 0 .../api/multi_load/query/10_30}/o/00.json | 0 .../api/multi_load/query/10_30/q/00.txt} | 0 .../api}/multi_load/query/10_40/00.json | 0 .../api}/multi_load/query/10_40/10.json | 0 .../api}/multi_load/query/10_40/20.json | 0 .../api}/multi_load/query/10_40/30.json | 0 .../api}/multi_load/query/10_40/40.json | 0 .../api/multi_load/query/10_40/e/00.json} | 0 .../api/multi_load/query/10_40}/o/00.json | 0 .../api/multi_load/query/10_40/q/00.txt} | 0 .../api}/multi_load/query/10_50/00.json | 0 .../api}/multi_load/query/10_50/10.json | 0 .../api}/multi_load/query/10_50/20.json | 0 .../api}/multi_load/query/10_50/30.json | 0 .../api}/multi_load/query/10_50/40.json | 0 .../api/multi_load/query/10_50/e/00.json} | 0 .../api/multi_load/query/10_50}/o/00.json | 0 .../api/multi_load/query/10_50/q/00.txt} | 0 .../api}/multi_load/query/20_00/00.json | 0 .../api}/multi_load/query/20_00/10.json | 0 .../api}/multi_load/query/20_00/20.json | 0 .../api}/multi_load/query/20_00/30.json | 0 .../api}/multi_load/query/20_00/40.json | 0 .../api/multi_load/query/20_00/e/00.json} | 0 .../api/multi_load/query/20_00}/o/00.json | 0 .../api/multi_load/query/20_00/q/00.txt} | 0 .../api}/multi_load/query/20_10/00.json | 0 .../api}/multi_load/query/20_10/10.json | 0 .../api}/multi_load/query/20_10/20.json | 0 .../api}/multi_load/query/20_10/30.json | 0 .../api}/multi_load/query/20_10/40.json | 0 .../api/multi_load/query/20_10/e/00.json} | 0 .../api/multi_load/query/20_10}/o/00.json | 0 .../api/multi_load/query/20_10/q/00.txt} | 0 .../api}/multi_load/query/20_20/00.json | 0 .../api}/multi_load/query/20_20/10.json | 0 .../api}/multi_load/query/20_20/20.json | 0 .../api}/multi_load/query/20_20/30.json | 0 .../api}/multi_load/query/20_20/40.json | 0 .../api/multi_load/query/20_20/e/00.json} | 0 .../api/multi_load/query/20_20}/o/00.json | 0 .../api/multi_load/query/20_20/q/00.txt} | 0 .../api/multi_load/schema}/00/00.json | 0 .../{ => 1/api}/multi_load/schema/00/10.json | 0 .../{ => 1/api}/multi_load/schema/00/20.json | 0 .../{ => 1/api}/multi_load/schema/00/30.json | 0 .../{ => 1/api}/multi_load/schema/00/40.json | 0 .../api/multi_load/schema/00/e/00.json} | 0 .../api/multi_load/schema/00}/o/00.json | 0 .../api/multi_load/schema/00/s/00.json} | 0 .../api}/multi_load/template/00/00.json | 0 .../api}/multi_load/template/00/30.json | 0 .../api}/multi_load/template/00/c/00.json | 0 .../api/multi_load/template/00/e/00.json} | 0 .../api}/multi_load/template/00/o/00.json | 0 .../api/multi_load/template/10}/00.json | 0 .../api}/multi_load/template/10/10.json | 0 .../api}/multi_load/template/10/20.json | 0 .../api}/multi_load/template/10/30.json | 0 .../api}/multi_load/template/10/c/00.json | 0 .../api/multi_load/template/10/e/00.json} | 0 .../api}/multi_load/template/10/o/00.json | 0 .../api}/multi_load/template/20/00.json | 0 .../api}/multi_load/template/20/10.json | 0 .../api}/multi_load/template/20/20.json | 0 .../api}/multi_load/template/20/30.json | 0 .../api/multi_load/template/20/e/00.json} | 0 .../res/{ => 1/api}/multi_load/template/20/o | 0 tests/res/1/api/open/basics | 1 + .../api}/single_load/ac_parser/10/00.conf | 0 .../api}/single_load/ac_parser/10/10.conf | 0 .../api}/single_load/ac_parser/10/20.conf | 0 .../{ => 1/api}/single_load/ac_parser/10/e | 0 .../api}/single_load/ac_parser/10/o/00.json | 0 .../api/single_load/ac_parser/10}/o/10.json | 0 .../api/single_load/ac_parser/10}/o/20.json | 0 .../api/single_load/basics/10}/00.json | 0 .../api/single_load/basics/10}/10.json | 0 .../{ => 1/api}/single_load/basics/10/20.json | 0 .../{ => 1/api}/single_load/basics/10/e/00.py | 0 .../{ => 1/api}/single_load/basics/10/e/10.py | 0 .../{ => 1/api}/single_load/basics/10/e/20.py | 0 .../{ => 1/api}/single_load/basics/20/00.json | 0 .../api/single_load/basics}/20/10.json | 0 .../{ => 1/api}/single_load/basics/20/20.json | 0 .../api/single_load/basics}/20/e/00.json | 0 .../api/single_load/basics/20/e}/10.json | 0 .../api/single_load/basics/20/e}/20.json | 0 .../{ => 1/api}/single_load/basics/30/00.json | 0 .../api/single_load/basics}/30/10.json | 0 .../{ => 1/api}/single_load/basics/30/20.json | 0 .../api/single_load/basics/30}/e/00.json | 0 .../api/single_load/basics/30/e}/10.json | 0 .../api/single_load/basics/30/e}/20.json | 0 .../api}/single_load/basics/30/o/00.json | 0 .../api/single_load/basics/30}/o/10.json | 0 .../api/single_load/basics/30}/o/20.json | 0 .../api}/single_load/multi_types/10/10.ini | 0 .../single_load/multi_types/10/20.properties | 0 .../api}/single_load/multi_types/10/e/10.json | 0 .../api}/single_load/multi_types/10/e/20.json | 0 .../api/single_load/multi_types/20}/10.sh | 0 .../api/single_load/multi_types/20}/e/10.json | 0 .../api}/single_load/multi_types/20/o/10.json | 0 .../api}/single_load/multi_types/30/00.xml | 0 .../api}/single_load/multi_types/30/10.xml | 0 .../api}/single_load/multi_types/30/20.xml | 0 .../api}/single_load/multi_types/30/e/00.json | 0 .../api}/single_load/multi_types/30/e/10.json | 0 .../api}/single_load/multi_types/30/e/20.json | 0 .../api/single_load/primitives/10}/10.json | 0 .../api}/single_load/primitives/10/20.json | 0 .../api}/single_load/primitives/10/30.json | 0 .../api/single_load/primitives/10}/40.json | 0 .../api}/single_load/primitives/10/e/10.py | 0 .../api}/single_load/primitives/10/e/20.py | 0 .../api}/single_load/primitives/10/e/30.py | 0 .../api}/single_load/primitives/10/e/40.py | 0 .../api}/single_load/query/10/00_00.json | 0 .../api}/single_load/query/10/00_10.json | 0 .../api}/single_load/query/10/10_00.json | 0 .../api}/single_load/query/10/10_10.json | 0 .../api}/single_load/query/10/10_20.json | 0 .../api}/single_load/query/10/10_30.json | 0 .../api/single_load/query/10/10_40.json} | 0 .../res/1/api/single_load/query/10/10_50.json | 1 + .../api}/single_load/query/10/20_00.json | 0 .../api}/single_load/query/10/20_10.json | 0 .../api}/single_load/query/10/20_20.json | 0 .../api/single_load/query/10}/e/00_00.json | 0 .../api/single_load/query/10}/e/00_10.json | 0 .../api/single_load/query/10/e}/10_00.json | 0 .../api/single_load/query/10}/e/10_10.json | 0 .../api/single_load/query/10}/e/10_20.json | 0 .../api/single_load/query/10}/e/10_30.json | 0 .../api}/single_load/query/10/e/10_40.json | 0 .../api/single_load/query/10}/e/10_50.json | 0 .../api}/single_load/query/10/e/20_00.json | 0 .../api/single_load/query/10}/e/20_10.json | 0 .../api/single_load/query/10}/e/20_20.json | 0 .../1/api/single_load/query/10/q/00_00.txt | 1 + .../api/single_load/query/10}/q/00_10.txt | 0 .../api/single_load/query/10}/q/10_00.txt | 0 .../api/single_load/query/10}/q/10_10.txt | 0 .../api}/single_load/query/10/q/10_20.txt | 0 .../api}/single_load/query/10/q/10_30.txt | 0 .../api}/single_load/query/10/q/10_40.txt | 0 .../api}/single_load/query/10/q/10_50.txt | 0 .../api/single_load/query/10}/q/20_00.txt | 0 .../api}/single_load/query/10/q/20_10.txt | 0 .../api}/single_load/query/10/q/20_20.txt | 0 .../{ => 1/api}/single_load/schema/10/00.json | 0 tests/res/1/api/single_load/schema/10/10.json | 1 + .../{ => 1/api}/single_load/schema/10/20.json | 0 tests/res/{ => 1/api}/single_load/schema/10/e | 0 .../api/single_load/schema/10/s}/00.json | 0 .../api/single_load/schema/10/s}/10.json | 0 .../api}/single_load/schema/10/s/20.json | 0 .../{ => 1/api}/single_load/template/00/00.j2 | 0 .../{ => 1/api}/single_load/template/00/10.j2 | 0 .../{ => 1/api}/single_load/template/00/20.j2 | 0 .../api}/single_load/template/00/c/00.json | 0 .../api}/single_load/template/00/c/10.json | 0 .../api}/single_load/template/00/c/20.json | 0 .../api}/single_load/template/00/e/00.json | 0 .../api}/single_load/template/00/e/10.json | 0 .../api}/single_load/template/00/e/20.json | 0 .../api}/single_load/template/00/o/00.json | 0 .../api/single_load/template/00}/o/10.json | 0 .../api/single_load/template/00}/o/20.json | 0 .../{ => 1/api}/single_load/template/10/00.j2 | 0 .../{ => 1/api}/single_load/template/10/10.j2 | 0 .../{ => 1/api}/single_load/template/10/20.j2 | 0 .../{ => 1/api}/single_load/template/10/30.j2 | 0 .../api}/single_load/template/10/c/00.json | 0 .../api}/single_load/template/10/c/10.json | 0 .../api}/single_load/template/10/c/20.json | 0 .../api}/single_load/template/10/c/30.json | 0 .../api}/single_load/template/10/e/00.json | 0 .../api}/single_load/template/10/e/10.json | 0 .../api/single_load/template/10/e}/20.json | 0 .../api/single_load/template/10/e}/30.json | 0 .../api}/single_load/template/10/o/00.json | 0 .../api/single_load/template}/10/o/10.json | 0 .../api/single_load/template}/10/o/20.json | 0 .../api/single_load/template/10/o}/30.json | 0 .../{ => 1/api}/single_load/template/20/00.j2 | 0 .../{ => 1/api}/single_load/template/20/10.j2 | 0 .../{ => 1/api}/single_load/template/20/20.j2 | 0 .../api}/single_load/template/20/c/00.json | 0 .../api}/single_load/template/20/c/10.json | 0 .../api}/single_load/template/20/c/20.json | 0 .../res/{ => 1/api}/single_load/template/20/e | 0 .../api}/single_load/template/20/o/00.json | 0 .../api/single_load/template/20}/o/10.json | 0 .../api/single_load/template/20}/o/20.json | 0 .../{ => 1/api}/single_load/toml/10/00.toml | 0 .../{ => 1/api}/single_load/toml/10/10.toml | 0 .../{ => 1/api}/single_load/toml/10/20.toml | 0 .../api/single_load/toml/10/e}/00.json | 0 .../api/single_load/toml/10/e}/10.json | 0 .../{ => 1/api}/single_load/toml/10/e/20.json | 0 .../{ => 1/api}/single_load/yaml/10/00.yml | 0 .../{ => 1/api}/single_load/yaml/10/10.yml | 0 .../{ => 1/api}/single_load/yaml/10/20.yml | 0 .../api/single_load/yaml}/10/e/00.json | 0 .../api/single_load/yaml}/10/e/10.json | 0 .../{ => 1/api}/single_load/yaml/10/e/20.json | 0 tests/res/{ => 1}/cli/basics/10/10.json | 0 tests/res/{ => 1}/cli/basics/10/e/10.json | 0 tests/res/{ => 1}/cli/basics/10/o/10.json | 0 tests/res/{ => 1}/cli/errors/10/10.json | 0 tests/res/{ => 1}/cli/errors/10/20.json | 0 tests/res/{ => 1}/cli/errors/10/30.json | 0 tests/res/{ => 1}/cli/errors/10/40.json | 0 tests/res/{ => 1}/cli/errors/10/50.json | 0 tests/res/{ => 1}/cli/errors/10/e/10.json | 0 tests/res/{ => 1}/cli/errors/10/e/20.json | 0 tests/res/{ => 1}/cli/errors/10/e/30.json | 0 tests/res/{ => 1}/cli/errors/10/e/40.json | 0 tests/res/{ => 1}/cli/errors/10/e/50.json | 0 tests/res/{ => 1}/cli/errors/10/o/10.json | 0 tests/res/{ => 1}/cli/errors/10/o/20.json | 0 tests/res/{ => 1}/cli/errors/10/o/30.json | 0 tests/res/{ => 1}/cli/errors/10/o/40.json | 0 tests/res/{ => 1}/cli/errors/10/o/50.json | 0 .../res/{ => 1}/cli/extra_options/10/10.json | 0 .../{ => 1}/cli/extra_options/10/e/10.json | 0 .../{ => 1}/cli/extra_options/10/o/10.json | 0 .../{ => 1}/cli/extra_options/10/on/10.json | 0 .../{ => 1}/cli/extra_options/10/r/10.json | 0 .../res/{ => 1}/cli/ignore_missing/10/10.json | 0 .../{ => 1}/cli/ignore_missing/10/e/10.json | 0 .../{ => 1}/cli/ignore_missing/10/o/10.json | 0 .../{ => 1}/cli/ignore_missing/10/on/10.json | 0 .../{ => 1}/cli/ignore_missing/10/r/10.json | 0 tests/res/{ => 1}/cli/multi_inputs/10/10.json | 0 .../10/e => 1/cli/multi_inputs/10}/20.json | 0 tests/res/{ => 1}/cli/multi_inputs/10/30.json | 0 .../res/{ => 1}/cli/multi_inputs/10/e/10.json | 0 .../res/{ => 1}/cli/multi_inputs/10/o/10.json | 0 .../{ => 1}/cli/multi_inputs/10/on/10.json | 0 .../res/{ => 1}/cli/multi_inputs/10/r/10.json | 0 tests/res/{ => 1}/cli/multi_inputs/20/10.json | 0 tests/res/{ => 1}/cli/multi_inputs/20/20.xml | 0 tests/res/{ => 1}/cli/multi_inputs/20/30.sh | 0 .../res/{ => 1}/cli/multi_inputs/20/e/10.json | 0 .../res/{ => 1}/cli/multi_inputs/20/o/10.json | 0 .../{ => 1}/cli/multi_inputs/20/on/10.json | 0 .../res/{ => 1}/cli/multi_inputs/20/r/10.json | 0 tests/res/{ => 1}/cli/no_template/10/10.json | 0 .../res/{ => 1}/cli/no_template/10/o/10.json | 0 .../res/{ => 1}/cli/no_template/10/on/10.json | 0 .../res/{ => 1}/cli/no_template/10/r/10.json | 0 tests/res/{ => 1}/cli/query/10/10.json | 0 tests/res/{ => 1}/cli/query/10/e/10.json | 0 tests/res/{ => 1}/cli/query/10/o/10.json | 0 tests/res/{ => 1}/cli/query/10/on/10.json | 0 tests/res/{ => 1}/cli/query/10/r/10.json | 0 tests/res/1/cli/schema/10/00.json | 1 + tests/res/1/cli/schema/10/10.json | 1 + tests/res/1/cli/schema/10/20.json | 1 + .../e/10.json => 1/cli/schema/10/e/00.json} | 0 .../basics/30/o => 1/cli/schema/10/e}/10.json | 0 .../basics/30/o => 1/cli/schema/10/e}/20.json | 0 .../o/10.json => 1/cli/schema/10/o/00.json} | 0 .../template/00 => 1/cli/schema/10}/o/10.json | 0 .../template/00 => 1/cli/schema/10}/o/20.json | 0 .../10 => 1/cli/schema/10/o}/30.json | 0 tests/res/1/cli/schema/10/s | 1 + .../res/{ => 1}/cli/schema_errors/10/10.json | 0 .../{ => 1}/cli/schema_errors/10/e/10.json | 0 tests/res/1/cli/schema_errors/10/o/10.json | 1 + tests/res/{ => 1}/cli/show/10/10.json | 0 tests/res/{ => 1}/cli/show/10/20.json | 0 tests/res/{ => 1}/cli/show/10/30.json | 0 tests/res/{ => 1}/cli/show/10/40.json | 0 tests/res/{ => 1}/cli/show/10/e/10.json | 0 tests/res/{ => 1}/cli/show/10/e/20.json | 0 tests/res/{ => 1}/cli/show/10/e/30.json | 0 tests/res/{ => 1}/cli/show/10/e/40.json | 0 .../show_version => 1/cli/show}/10/o/10.json | 0 .../basics/20/e => 1/cli/show/10/o}/20.json | 0 tests/res/{ => 1}/cli/show/10/o/30.json | 0 tests/res/{ => 1}/cli/show/10/o/40.json | 0 tests/res/{ => 1}/cli/show/20/10.json | 0 tests/res/{ => 1}/cli/show/20/20.json | 0 tests/res/{ => 1}/cli/show/20/e/10.json | 0 tests/res/{ => 1}/cli/show/20/e/20.json | 0 .../10/r => 1/cli/show/20/o}/10.json | 0 .../basics/30/e => 1/cli/show/20/o}/20.json | 0 tests/res/{ => 1}/cli/show_version/10/10.json | 0 .../res/{ => 1}/cli/show_version/10/e/10.json | 0 .../10/r => 1/cli/show_version/10/o}/10.json | 0 tests/res/{ => 1}/cli/single_input/10/10.json | 0 tests/res/{ => 1}/cli/single_input/10/20.conf | 0 .../10/e => 1/cli/single_input/10}/30.json | 0 .../res/{ => 1}/cli/single_input/10/e/10.json | 0 .../10 => 1/cli/single_input/10/e}/20.json | 0 .../10/r => 1/cli/single_input/10/e}/30.json | 0 .../res/{ => 1}/cli/single_input/10/o/10.json | 0 .../res/{ => 1}/cli/single_input/10/o/20.json | 0 .../res/{ => 1}/cli/single_input/10/o/30.json | 0 .../{ => 1}/cli/single_input/10/on/10.json | 0 .../10/e => 1/cli/single_input/10/on}/20.json | 0 .../{ => 1}/cli/single_input/10/on/30.json | 0 .../{ => 1}/cli/single_input/10/oo/10.json | 0 .../on => 1/cli/single_input/10/oo}/20.json | 0 .../{ => 1}/cli/single_input/10/oo/30.json | 0 .../10/e => 1/cli/single_input/10/r}/10.json | 0 .../10/oo => 1/cli/single_input/10/r}/20.json | 0 .../20 => 1/cli/single_input/10/r}/30.json | 0 .../40 => 1/cli/single_input/20}/10.json | 0 .../10/r => 1/cli/single_input/20}/20.json | 0 .../20/on => 1/cli/single_input/20}/30.json | 0 .../res/{ => 1}/cli/single_input/20/e/10.json | 0 .../20 => 1/cli/single_input/20/e}/20.json | 0 .../res/{ => 1}/cli/single_input/20/e/30.json | 0 .../res/{ => 1}/cli/single_input/20/o/10.json | 0 .../res/{ => 1}/cli/single_input/20/o/20.json | 0 .../res/{ => 1}/cli/single_input/20/o/30.json | 0 .../{ => 1}/cli/single_input/20/on/10.json | 0 .../20/e => 1/cli/single_input/20/on}/20.json | 0 .../10/e => 1/cli/single_input/20/on}/30.json | 0 .../10 => 1/cli/single_input/20/r}/10.json | 0 .../cli/single_input/20/r/20.json} | 0 .../20 => 1/cli/single_input/30}/10.json | 0 .../20/on => 1/cli/single_input/30}/20.json | 0 .../res/{ => 1}/cli/single_input/30/e/10.json | 0 .../30 => 1/cli/single_input/30/e}/20.json | 0 .../res/{ => 1}/cli/single_input/30/o/10.json | 0 .../res/{ => 1}/cli/single_input/30/o/20.json | 0 .../{ => 1}/cli/single_input/30/on/10.json | 0 .../30/e => 1/cli/single_input/30/on}/20.json | 0 .../res/{ => 1}/cli/single_input/30/r/10.json | 0 .../res/{ => 1}/cli/single_input/30/r/20.json | 0 .../30 => 1/cli/single_input/40}/10.json | 0 .../res/{ => 1}/cli/single_input/40/e/10.json | 0 .../res/{ => 1}/cli/single_input/40/o/10.json | 0 .../{ => 1}/cli/single_input/40/on/10.json | 0 .../res/{ => 1}/cli/single_input/40/r/10.json | 0 .../10 => 1/cli/single_input/50}/10.json | 0 .../res/{ => 1}/cli/single_input/50/e/10.json | 0 .../res/{ => 1}/cli/single_input/50/o/10.json | 0 .../{ => 1}/cli/single_input/50/on/10.json | 0 .../10/s => 1/cli/single_input/50/r}/10.json | 0 .../single_input_to_yaml_output/10}/10.json | 0 .../single_input_to_yaml_output/10}/20.json | 0 .../cli/single_input_to_yaml_output/10/30.yml | 0 .../cli/single_input_to_yaml_output/10/40.yml | 0 .../single_input_to_yaml_output/10/e/10.json | 0 .../single_input_to_yaml_output/10/e}/20.json | 0 .../single_input_to_yaml_output/10/e}/30.json | 0 .../single_input_to_yaml_output/10/e/40.json | 0 .../single_input_to_yaml_output/10/o/10.json | 0 .../single_input_to_yaml_output/10/o/20.json | 0 .../single_input_to_yaml_output/10/o}/30.json | 0 .../single_input_to_yaml_output/10/o/40.json | 0 .../single_input_to_yaml_output/10/on/10.json | 0 .../10/on}/20.json | 0 .../single_input_to_yaml_output/10/on/30.json | 0 .../single_input_to_yaml_output/10/on/40.json | 0 .../single_input_to_yaml_output/10/oo/10.json | 0 .../10/oo}/20.json | 0 .../single_input_to_yaml_output/10/oo/30.json | 0 .../single_input_to_yaml_output/10/oo/40.json | 0 .../single_input_to_yaml_output/10/r}/10.json | 0 .../single_input_to_yaml_output/10/r}/20.json | 0 .../single_input_to_yaml_output/10/r/30.json | 0 .../single_input_to_yaml_output/10/r/40.json | 0 .../cli/template}/10/10.json | 0 tests/res/{ => 1}/cli/template/10/20.json | 0 tests/res/{ => 1}/cli/template/10/e/10.json | 0 .../10/r => 1/cli/template/10/e}/20.json | 0 tests/res/{ => 1}/cli/template/10/o/10.json | 0 .../10/e => 1/cli/template/10/o}/20.json | 0 tests/res/{ => 1}/cli/template/10/on/10.json | 0 .../10/o => 1/cli/template/10/on}/20.json | 0 tests/res/{ => 1}/cli/template/10/r/10.json | 0 tests/res/{ => 1}/cli/template/10/r/20.json | 0 tests/res/1/common/tdc/10/100_null.json | 1 + tests/res/1/common/tdc/10/e/100_null.json.py | 1 + tests/res/1/common/tdc/20/220_a_list.json | 1 + .../res/1/common/tdc/20/e/220_a_list.json.py | 1 + .../1/common/tdc/20/o/220_a_list.json.json | 1 + tests/res/{ => 1}/dicts/get/10/10.json | 0 .../template/10/on => 1/dicts/get/10}/20.json | 0 .../basics/30 => 1/dicts/get/10}/e/10.json | 0 .../e/00_00.json => 1/dicts/get/10/e/20.json} | 0 tests/res/{ => 1}/dicts/get/10/q/10.py | 0 tests/res/{ => 1}/dicts/get/10/q/20.py | 0 tests/res/{ => 1}/dicts/get/10/s/10.py | 0 tests/res/{ => 1}/dicts/get/10/s/20.py | 0 tests/res/{ => 1}/dicts/get/20/00.json | 0 .../template/10/o => 1/dicts/get/20}/10.json | 0 tests/res/{ => 1}/dicts/get/20/100.json | 0 tests/res/{ => 1}/dicts/get/20/110.json | 0 .../template/10/o => 1/dicts/get/20}/20.json | 0 .../template/10/o => 1/dicts/get/20}/30.json | 0 tests/res/{ => 1}/dicts/get/20/40.json | 0 tests/res/{ => 1}/dicts/get/20/50.json | 0 tests/res/{ => 1}/dicts/get/20/60.json | 0 tests/res/{ => 1}/dicts/get/20/70.json | 0 tests/res/{ => 1}/dicts/get/20/80.json | 0 tests/res/{ => 1}/dicts/get/20/90.json | 0 .../basics/30 => 1/dicts/get/20}/e/00.json | 0 tests/res/{ => 1}/dicts/get/20/e/10.json | 0 tests/res/{ => 1}/dicts/get/20/e/100.py | 0 tests/res/{ => 1}/dicts/get/20/e/110.py | 0 tests/res/{ => 1}/dicts/get/20/e/20.py | 0 tests/res/{ => 1}/dicts/get/20/e/30.py | 0 .../e/10.txt => 1/dicts/get/20/e/40.py} | 0 tests/res/{ => 1}/dicts/get/20/e/50.py | 0 tests/res/{ => 1}/dicts/get/20/e/60.py | 0 tests/res/{ => 1}/dicts/get/20/e/70.py | 0 tests/res/{ => 1}/dicts/get/20/e/80.py | 0 tests/res/{ => 1}/dicts/get/20/e/90.py | 0 tests/res/{ => 1}/dicts/get/20/q/00.py | 0 tests/res/{ => 1}/dicts/get/20/q/10.py | 0 tests/res/{ => 1}/dicts/get/20/q/100.py | 0 tests/res/{ => 1}/dicts/get/20/q/110.py | 0 tests/res/{ => 1}/dicts/get/20/q/20.py | 0 tests/res/{ => 1}/dicts/get/20/q/30.py | 0 tests/res/{ => 1}/dicts/get/20/q/40.py | 0 tests/res/{ => 1}/dicts/get/20/q/50.py | 0 tests/res/{ => 1}/dicts/get/20/q/60.py | 0 tests/res/{ => 1}/dicts/get/20/q/70.py | 0 tests/res/{ => 1}/dicts/get/20/q/80.py | 0 tests/res/{ => 1}/dicts/get/20/q/90.py | 0 tests/res/{ => 1}/dicts/get/20/s/00.py | 0 tests/res/{ => 1}/dicts/get/20/s/10.py | 0 tests/res/{ => 1}/dicts/get/20/s/100.py | 0 tests/res/{ => 1}/dicts/get/20/s/110.py | 0 tests/res/{ => 1}/dicts/get/20/s/20.py | 0 tests/res/{ => 1}/dicts/get/20/s/30.py | 0 tests/res/{ => 1}/dicts/get/20/s/40.py | 0 tests/res/{ => 1}/dicts/get/20/s/50.py | 0 tests/res/{ => 1}/dicts/get/20/s/60.py | 0 tests/res/{ => 1}/dicts/get/20/s/70.py | 0 tests/res/{ => 1}/dicts/get/20/s/80.py | 0 tests/res/{ => 1}/dicts/get/20/s/90.py | 0 tests/res/{ => 1}/dicts/get/30/10.json | 0 .../{dicts/get/10 => 1/dicts/get/30}/20.json | 0 .../get/30/20.json => 1/dicts/get/30/30.json} | 0 tests/res/{ => 1}/dicts/get/30/e/10.py | 0 .../e/20_20.json => 1/dicts/get/30/e/20.json} | 0 tests/res/1/dicts/get/30/e/30.json | 1 + tests/res/{ => 1}/dicts/get/30/q/10.txt | 0 tests/res/{ => 1}/dicts/get/30/q/20.txt | 0 tests/res/{ => 1}/dicts/get/30/q/30.txt | 0 .../10/00.txt => 1/dicts/get/30/s/10.txt} | 0 tests/res/{ => 1}/dicts/get/30/s/20.txt | 0 tests/res/{ => 1}/dicts/get/30/s/30.txt | 0 tests/res/{ => 1}/dicts/merge/10/10.json | 0 tests/res/{ => 1}/dicts/merge/10/e/10.json | 0 tests/res/{ => 1}/dicts/merge/10/o/10.json | 0 tests/res/{ => 1}/dicts/merge/10/s/10.json | 0 .../merge/40 => 1/dicts/merge/20}/10.json | 0 tests/res/{ => 1}/dicts/merge/20/e/10.json | 0 tests/res/{ => 1}/dicts/merge/20/o/10.json | 0 tests/res/{ => 1}/dicts/merge/20/s/10.json | 0 .../basics/20 => 1/dicts/merge/30}/10.json | 0 tests/res/{ => 1}/dicts/merge/30/e/10.json | 0 tests/res/{ => 1}/dicts/merge/30/o/10.json | 0 tests/res/{ => 1}/dicts/merge/30/s/10.json | 0 .../basics/30 => 1/dicts/merge/40}/10.json | 0 tests/res/{ => 1}/dicts/merge/40/e/10.json | 0 tests/res/{ => 1}/dicts/merge/40/o/10.json | 0 tests/res/{ => 1}/dicts/merge/40/s/10.json | 0 .../res/{ => 1}/dicts/mk_nested_dic/10/10.py | 0 .../res/{ => 1}/dicts/mk_nested_dic/10/20.py | 0 .../{ => 1}/dicts/mk_nested_dic/10/e/10.json | 0 .../{ => 1}/dicts/mk_nested_dic/10/e/20.json | 0 .../{ => 1}/dicts/mk_nested_dic/10/o/10.json | 0 .../{ => 1}/dicts/mk_nested_dic/10/o/20.json | 0 .../dicts/mk_nested_dic/10/q/10.py} | 0 .../{ => 1}/dicts/mk_nested_dic/10/q/20.py | 0 .../parser/attrlist/10/00.txt} | 0 tests/res/{ => 1}/parser/attrlist/10/10.txt | 0 tests/res/{ => 1}/parser/attrlist/10/20.txt | 0 tests/res/{ => 1}/parser/attrlist/10/30.txt | 0 tests/res/{ => 1}/parser/attrlist/10/40.txt | 0 .../00/o => 1/parser/attrlist/10/e}/00.json | 0 .../res/{ => 1}/parser/attrlist/10/e/10.json | 0 .../res/{ => 1}/parser/attrlist/10/e/20.json | 0 .../res/{ => 1}/parser/attrlist/10/e/30.json | 0 .../res/{ => 1}/parser/attrlist/10/e/40.json | 0 tests/res/{ => 1}/parser/attrlist_0/10/00.txt | 0 tests/res/{ => 1}/parser/attrlist_0/10/10.txt | 0 tests/res/{ => 1}/parser/attrlist_0/10/20.txt | 0 tests/res/{ => 1}/parser/attrlist_0/10/30.txt | 0 tests/res/{ => 1}/parser/attrlist_0/10/40.txt | 0 .../{ => 1}/parser/attrlist_0/10/e/00.json | 0 .../res/{ => 1}/parser/attrlist_0/10/e/10.py | 0 .../res/{ => 1}/parser/attrlist_0/10/e/20.py | 0 .../res/{ => 1}/parser/attrlist_0/10/e/30.py | 0 .../res/{ => 1}/parser/attrlist_0/10/e/40.py | 0 .../parser/list/10/00.txt} | 0 tests/res/{ => 1}/parser/list/10/10.txt | 0 tests/res/{ => 1}/parser/list/10/20.txt | 0 tests/res/{ => 1}/parser/list/10/30.txt | 0 tests/res/{ => 1}/parser/list/10/40.txt | 0 tests/res/{ => 1}/parser/list/10/50.txt | 0 tests/res/{ => 1}/parser/list/10/e/00.json | 0 tests/res/{ => 1}/parser/list/10/e/10.json | 0 tests/res/{ => 1}/parser/list/10/e/20.json | 0 tests/res/{ => 1}/parser/list/10/e/30.json | 0 tests/res/{ => 1}/parser/list/10/e/40.json | 0 tests/res/{ => 1}/parser/list/10/e/50.json | 0 .../10/e => 1/parser/list/10/o}/00.json | 0 .../20 => 1/parser/list/10}/o/10.json | 0 .../20 => 1/parser/list/10}/o/20.json | 0 .../o/40.json => 1/parser/list/10/o/30.json} | 0 tests/res/1/parser/list/10/o/40.json | 1 + tests/res/{ => 1}/parser/list/10/o/50.json | 0 tests/res/{ => 1}/parser/parse/10/00.py | 0 tests/res/{ => 1}/parser/parse/10/10.txt | 0 tests/res/{ => 1}/parser/parse/10/20.txt | 0 tests/res/{ => 1}/parser/parse/10/30.txt | 0 tests/res/{ => 1}/parser/parse/10/40.py | 0 tests/res/{ => 1}/parser/parse/10/50.py | 0 tests/res/{ => 1}/parser/parse/10/60.txt | 0 tests/res/{ => 1}/parser/parse/10/70.txt | 0 tests/res/{ => 1}/parser/parse/10/e | 0 tests/res/{ => 1}/parser/parse/20/20.txt | 0 tests/res/{ => 1}/parser/parse/20/30.txt | 0 tests/res/{ => 1}/parser/parse/20/40.txt | 0 tests/res/{ => 1}/parser/parse/20/e | 0 tests/res/{ => 1}/parser/parse/30/10.txt | 0 tests/res/{ => 1}/parser/parse/30/20.txt | 0 tests/res/{ => 1}/parser/parse/30/30.txt | 0 tests/res/{ => 1}/parser/parse/30/40.txt | 0 tests/res/{ => 1}/parser/parse/30/e | 0 tests/res/{ => 1}/parser/single/10/00.py | 0 tests/res/{ => 1}/parser/single/10/10.txt | 0 tests/res/{ => 1}/parser/single/10/20.txt | 0 tests/res/{ => 1}/parser/single/10/30.txt | 0 tests/res/{ => 1}/parser/single/10/40.py | 0 tests/res/{ => 1}/parser/single/10/50.py | 0 tests/res/{ => 1}/parser/single/10/60.txt | 0 tests/res/{ => 1}/parser/single/10/70.txt | 0 tests/res/{ => 1}/parser/single/10/e/00.py | 0 tests/res/{ => 1}/parser/single/10/e/10.py | 0 tests/res/{ => 1}/parser/single/10/e/20.py | 0 tests/res/{ => 1}/parser/single/10/e/30.py | 0 tests/res/{ => 1}/parser/single/10/e/40.py | 0 tests/res/{ => 1}/parser/single/10/e/50.py | 0 tests/res/{ => 1}/parser/single/10/e/60.py | 0 tests/res/{ => 1}/parser/single/10/e/70.py | 0 tests/res/cli/errors/10/README.md | 7 - tests/res/cli/extra_options/10/README.md | 3 - tests/res/cli/ignore_missing/10/README.md | 3 - tests/res/cli/multi_inputs/10/README.md | 3 - tests/res/cli/multi_inputs/10/i/10.json | 1 - tests/res/cli/multi_inputs/20/README.md | 3 - tests/res/cli/multi_inputs/20/i/10.json | 1 - tests/res/cli/schema/10/e/20.json | 1 - tests/res/cli/schema/10/s/20.json | 1 - tests/res/cli/schema_errors/10/README.md | 3 - tests/res/cli/show/10/README.md | 7 - tests/res/cli/show/20/README.md | 4 - tests/res/cli/show_version/10/README.md | 3 - tests/res/cli/single_input/10/README.md | 5 - tests/res/cli/single_input/30/README.md | 4 - tests/res/cli/single_input/40/README.md | 3 - tests/res/cli/single_input/50/README.md | 3 - tests/res/cli/single_input/50/r/10.json | 1 - .../single_input_to_yaml_output/10/README.md | 6 - tests/res/cli/template/10/10.json | 1 - tests/res/dump/basics/10/00.json | 1 - tests/res/dump/basics/10/10.json | 1 - tests/res/dump/basics/10/20.json | 1 - tests/res/dump/basics/20/00.json | 1 - tests/res/dump/basics/20/10.json | 1 - tests/res/dump/basics/20/20.json | 1 - tests/res/dump/basics/20/o/00.json | 1 - tests/res/dumps/basics/10/00.json | 1 - tests/res/dumps/basics/10/10.json | 1 - tests/res/dumps/basics/10/20.json | 1 - tests/res/dumps/basics/10/e/00.txt | 1 - tests/res/dumps/basics/10/e/10.txt | 1 - tests/res/dumps/basics/10/e/20.txt | 1 - tests/res/dumps/basics/20/00.json | 1 - tests/res/dumps/basics/20/10.json | 1 - tests/res/dumps/basics/20/20.json | 1 - tests/res/dumps/basics/20/e/00.txt | 1 - tests/res/dumps/basics/20/e/10.txt | 1 - tests/res/dumps/basics/20/e/20.txt | 1 - tests/res/json/primitives/e/20.txt | 1 - tests/res/json/query/00_00.json | 1 - tests/res/json/query/00_10.json | 1 - tests/res/json/query/10_00.json | 1 - tests/res/json/query/10_10.json | 1 - tests/res/json/query/10_20.json | 1 - tests/res/json/query/10_30.json | 1 - tests/res/json/query/10_40.json | 1 - tests/res/json/query/20_00.json | 1 - tests/res/json/query/20_10.json | 1 - tests/res/json/query/20_20.json | 1 - tests/res/json/template/10.json | 1 - tests/res/json/template/20.json | 1 - tests/res/json/template/ctx/00.json | 1 - tests/res/json/template/ctx/10.json | 1 - tests/res/json/template/ctx/20.json | 1 - tests/res/json/template/e/00.json | 1 - tests/res/json/template/e/10.json | 1 - tests/res/json/template/e/20.json | 1 - tests/res/loads/basics/10/00.txt | 1 - tests/res/loads/basics/10/10.txt | 1 - tests/res/loads/basics/10/20.txt | 1 - tests/res/loads/query/10/00_00.txt | 1 - tests/res/loads/query/10/00_10.txt | 1 - tests/res/loads/query/10/10_00.txt | 1 - tests/res/loads/query/10/10_10.txt | 1 - tests/res/loads/query/10/10_20.txt | 1 - tests/res/loads/query/10/10_30.txt | 1 - tests/res/loads/query/10/10_40.txt | 1 - tests/res/loads/query/10/20_00.txt | 1 - tests/res/loads/query/10/20_10.txt | 1 - tests/res/loads/query/10/20_20.txt | 1 - tests/res/loads/query/10/e | 1 - tests/res/loads/query/10/q | 1 - tests/res/loads/schema/10/00.txt | 1 - tests/res/loads/schema/10/10.txt | 1 - tests/res/loads/schema/10/20.txt | 1 - tests/res/loads/schema/10/s/00.txt | 1 - tests/res/loads/schema/10/s/10.txt | 1 - tests/res/loads/schema/10/s/20.txt | 1 - tests/res/loads/template/10/00.txt | 1 - tests/res/loads/template/10/10.txt | 1 - tests/res/loads/template/10/20.txt | 1 - tests/res/loads/template/10/c | 1 - tests/res/loads/template/10/e | 1 - tests/res/multi_load/basics/00/s/00.json | 1 - tests/res/multi_load/query/00_00/e/exp.json | 1 - tests/res/multi_load/query/00_00/q/q.txt | 1 - tests/res/multi_load/query/00_10/e/exp.json | 1 - tests/res/multi_load/query/00_10/q/q.txt | 1 - tests/res/multi_load/query/10_10/e/exp.json | 1 - tests/res/multi_load/query/10_10/q/q.txt | 1 - tests/res/multi_load/query/10_20/q/q.txt | 1 - tests/res/multi_load/query/10_30/e/exp.json | 1 - tests/res/multi_load/query/10_30/q/q.txt | 1 - tests/res/multi_load/query/10_40/e/exp.json | 1 - tests/res/multi_load/query/10_40/q/q.txt | 1 - tests/res/multi_load/query/10_50/e/exp.json | 1 - tests/res/multi_load/query/10_50/q/q.txt | 1 - tests/res/multi_load/query/20_00/e/exp.json | 1 - tests/res/multi_load/query/20_00/q/q.txt | 1 - tests/res/multi_load/query/20_10/e/exp.json | 1 - tests/res/multi_load/query/20_10/q/q.txt | 1 - tests/res/multi_load/query/20_20/e/exp.json | 1 - tests/res/multi_load/query/20_20/q/q.txt | 1 - tests/res/multi_load/template/10/00.json | 1 - tests/res/multi_load/template/10/e/exp.json | 1 - tests/res/open/basics/10 | 1 - tests/res/parser/list/10/o/00.json | 1 - tests/res/single_load/multi_types/20/10.sh | 5 - .../res/single_load/multi_types/20/e/10.json | 8 - tests/res/single_load/primitives/10/40.json | 1 - tests/res/single_load/query/10/e/10_00.json | 1 - tests/res/single_load/query/10/e/10_10.json | 1 - tests/res/single_load/query/10/e/10_20.json | 1 - tests/res/single_load/query/10/e/10_30.json | 1 - tests/res/single_load/query/10/e/10_50.json | 1 - tests/res/single_load/query/10/e/20_10.json | 1 - tests/res/single_load/query/10/q/00_10.txt | 1 - tests/res/single_load/query/10/q/10_00.txt | 1 - tests/res/single_load/query/10/q/10_10.txt | 1 - tests/res/single_load/query/10/q/20_00.txt | 1 - tests/res/single_load/schema/10/s/00.json | 1 - tests/res/single_load/schema/10/s/10.json | 1 - tests/res/single_load/yaml/10/e/00.json | 1 - tests/res/single_load/yaml/10/e/10.json | 1 - tests/template/test_jinja2.py | 177 ++++--- tests/test_lib.py | 29 +- tests/test_singleton.py | 55 ++- tests/utils/test_detectors.py | 2 + tests/utils/test_files.py | 51 +- tests/utils/test_lists.py | 51 +- tests/utils/test_utils.py | 28 +- 940 files changed, 3750 insertions(+), 2964 deletions(-) delete mode 100644 tests/api/dump/common.py delete mode 100644 tests/api/dumps/common.py rename tests/{res/dicts/get/30/s/10.txt => api/load/multi_load/__init__.py} (100%) create mode 100644 tests/api/load/multi_load/common.py create mode 100644 tests/api/load/multi_load/test_basics.py create mode 100644 tests/api/load/multi_load/test_multi_types.py create mode 100644 tests/api/load/multi_load/test_query.py create mode 100644 tests/api/load/multi_load/test_schema.py create mode 100644 tests/api/load/multi_load/test_template.py rename tests/{res/parser/attrlist/10/00.txt => api/load/single_load/__init__.py} (100%) create mode 100644 tests/api/load/single_load/test_ac_parser.py create mode 100644 tests/api/load/single_load/test_basics.py create mode 100644 tests/api/load/single_load/test_multi_types.py create mode 100644 tests/api/load/single_load/test_primitives.py create mode 100644 tests/api/load/single_load/test_query.py create mode 100644 tests/api/load/single_load/test_schema.py create mode 100644 tests/api/load/single_load/test_template.py create mode 100644 tests/api/load/single_load/test_toml.py create mode 100644 tests/api/load/single_load/test_yaml.py delete mode 100644 tests/api/load/test_basics.py delete mode 100644 tests/api/load/test_multi_types.py delete mode 100644 tests/api/load/test_query.py delete mode 100644 tests/api/load/test_schema.py delete mode 100644 tests/api/load/test_templates.py delete mode 100644 tests/api/loads/common.py delete mode 100644 tests/api/multi_load/collector.py delete mode 100644 tests/api/multi_load/datatypes.py delete mode 100644 tests/api/multi_load/test_collector.py delete mode 100644 tests/api/multi_load/test_common.py delete mode 100644 tests/api/multi_load/test_utils.py delete mode 100644 tests/api/multi_load/utils.py delete mode 100644 tests/api/open/common.py delete mode 100644 tests/api/single_load/common.py create mode 100644 tests/api/single_load/constants.py delete mode 100644 tests/api/single_load/test_common.py delete mode 100644 tests/api/single_load/test_optional_types.py create mode 100644 tests/api/single_load/test_toml.py create mode 100644 tests/api/single_load/test_yaml.py delete mode 100644 tests/cli/collectors.py create mode 100644 tests/cli/common.py delete mode 100644 tests/cli/test_base.py create mode 100644 tests/cli/test_schema_errors.py create mode 100644 tests/common/tdc.py create mode 100644 tests/common/test_tdc.py delete mode 100644 tests/dicts/common.py delete mode 100644 tests/parser/common.py create mode 120000 tests/res/1/api/dump create mode 120000 tests/res/1/api/dumps/basics/10/00.json create mode 120000 tests/res/1/api/dumps/basics/10/10.json create mode 120000 tests/res/1/api/dumps/basics/10/20.json rename tests/res/{dump => 1/api/dumps}/basics/10/e/00.txt (100%) rename tests/res/{dump => 1/api/dumps}/basics/10/e/10.txt (100%) rename tests/res/{dump => 1/api/dumps}/basics/10/e/20.txt (100%) rename tests/res/{ => 1/api}/dumps/basics/10/o/00.json (100%) rename tests/res/{dicts/get/20 => 1/api/dumps/basics/10/o}/10.json (100%) rename tests/res/{dicts/get/20 => 1/api/dumps/basics/10/o}/20.json (100%) create mode 120000 tests/res/1/api/dumps/basics/20/00.json create mode 120000 tests/res/1/api/dumps/basics/20/10.json create mode 120000 tests/res/1/api/dumps/basics/20/20.json rename tests/res/{dump => 1/api/dumps}/basics/20/e/00.txt (100%) rename tests/res/{dump => 1/api/dumps}/basics/20/e/10.txt (100%) rename tests/res/{dump => 1/api/dumps}/basics/20/e/20.txt (100%) rename tests/res/{ => 1/api}/dumps/basics/20/o/00.json (100%) rename tests/res/{dump/basics/10 => 1/api/dumps/basics/20}/o/10.json (100%) rename tests/res/{dump/basics/10 => 1/api/dumps/basics/20}/o/20.json (100%) rename tests/res/{load/multi => 1/api/load/multi_load} (100%) rename tests/res/{load/single => 1/api/load/single_load} (100%) create mode 120000 tests/res/1/api/loads/basics/10/00.txt create mode 120000 tests/res/1/api/loads/basics/10/10.txt create mode 120000 tests/res/1/api/loads/basics/10/20.txt rename tests/res/{ => 1/api}/loads/basics/10/e/00.json (100%) rename tests/res/{ => 1/api}/loads/basics/10/e/10.json (100%) rename tests/res/{ => 1/api}/loads/basics/10/e/20.json (100%) rename tests/res/{ => 1/api}/loads/basics/10/o/00.json (100%) rename tests/res/{dump/basics/20 => 1/api/loads/basics/10}/o/10.json (100%) rename tests/res/{dump/basics/20 => 1/api/loads/basics/10}/o/20.json (100%) create mode 120000 tests/res/1/api/loads/query/10/00_00.txt create mode 120000 tests/res/1/api/loads/query/10/00_10.txt create mode 120000 tests/res/1/api/loads/query/10/10_00.txt create mode 120000 tests/res/1/api/loads/query/10/10_10.txt create mode 120000 tests/res/1/api/loads/query/10/10_20.txt create mode 120000 tests/res/1/api/loads/query/10/10_30.txt create mode 120000 tests/res/1/api/loads/query/10/10_40.txt create mode 120000 tests/res/1/api/loads/query/10/10_50.txt create mode 120000 tests/res/1/api/loads/query/10/20_00.txt create mode 120000 tests/res/1/api/loads/query/10/20_10.txt create mode 120000 tests/res/1/api/loads/query/10/20_20.txt create mode 120000 tests/res/1/api/loads/query/10/e rename tests/res/{ => 1/api}/loads/query/10/o/00_00.json (100%) rename tests/res/{ => 1/api}/loads/query/10/o/00_10.json (100%) rename tests/res/{json/query/e => 1/api/loads/query/10/o}/10_00.json (100%) rename tests/res/{ => 1/api}/loads/query/10/o/10_10.json (100%) rename tests/res/{ => 1/api}/loads/query/10/o/10_20.json (100%) rename tests/res/{ => 1/api}/loads/query/10/o/10_30.json (100%) rename tests/res/{ => 1/api}/loads/query/10/o/10_40.json (100%) rename tests/res/{json/query/e/20_00.json => 1/api/loads/query/10/o/10_50.json} (100%) rename tests/res/{ => 1/api}/loads/query/10/o/20_00.json (100%) rename tests/res/{ => 1/api}/loads/query/10/o/20_10.json (100%) rename tests/res/{ => 1/api}/loads/query/10/o/20_20.json (100%) create mode 120000 tests/res/1/api/loads/query/10/q create mode 120000 tests/res/1/api/loads/schema/10/00.txt create mode 120000 tests/res/1/api/loads/schema/10/10.txt create mode 120000 tests/res/1/api/loads/schema/10/20.txt rename tests/res/{ => 1/api}/loads/schema/10/e (100%) rename tests/res/{ => 1/api}/loads/schema/10/o (100%) create mode 120000 tests/res/1/api/loads/schema/10/s/00.txt create mode 120000 tests/res/1/api/loads/schema/10/s/10.txt create mode 120000 tests/res/1/api/loads/schema/10/s/20.txt create mode 120000 tests/res/1/api/loads/template/10/00.txt create mode 120000 tests/res/1/api/loads/template/10/10.txt create mode 120000 tests/res/1/api/loads/template/10/20.txt create mode 120000 tests/res/1/api/loads/template/10/30.txt create mode 120000 tests/res/1/api/loads/template/10/c create mode 120000 tests/res/1/api/loads/template/10/e rename tests/res/{ => 1/api}/loads/template/10/o/00.json (100%) rename tests/res/{dumps/basics => 1/api/loads/template}/10/o/10.json (100%) rename tests/res/{dumps/basics => 1/api/loads/template}/10/o/20.json (100%) rename tests/res/{dicts/get/20 => 1/api/loads/template/10/o}/30.json (100%) rename tests/res/{json/basic => 1/api/multi_load/basics/00}/00.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/00/10.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/00/20.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/00/30.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/00/40.json (100%) rename tests/res/{json/basic/20.json => 1/api/multi_load/basics/00/e/00.json} (100%) rename tests/res/{dump/basics/10 => 1/api/multi_load/basics/00}/o/00.json (100%) rename tests/res/{multi_load/schema => 1/api/multi_load/basics}/00/s/00.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/10/00.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/10/10.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/10/20.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/10/30.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/10/40.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/10/50.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/10/e (100%) rename tests/res/{ => 1/api}/multi_load/basics/10/o/00.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/20/00.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/20/10.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/20/20.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/20/30.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/20/40.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/20/50.json (100%) rename tests/res/{multi_load/basics/20/e/exp.json => 1/api/multi_load/basics/20/e/00.json} (100%) rename tests/res/{ => 1/api}/multi_load/basics/20/o/00.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/30/00.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/30/10.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/30/20.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/30/30.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/30/40.json (100%) rename tests/res/{ => 1/api}/multi_load/basics/30/50.json (100%) rename tests/res/{multi_load/basics/30/e/exp.json => 1/api/multi_load/basics/30/e/00.json} (100%) rename tests/res/{ => 1/api}/multi_load/basics/30/o/00.json (100%) rename tests/res/{ => 1/api}/multi_load/multi_types/10/00.json (100%) rename tests/res/{ => 1/api}/multi_load/multi_types/10/10.ini (100%) rename tests/res/{ => 1/api}/multi_load/multi_types/10/20.json (100%) rename tests/res/{ => 1/api}/multi_load/multi_types/10/30.json (100%) rename tests/res/{ => 1/api}/multi_load/multi_types/10/40.properties (100%) rename tests/res/{ => 1/api}/multi_load/multi_types/10/50.sh (100%) rename tests/res/{multi_load/multi_types/10/e/exp.json => 1/api/multi_load/multi_types/10/e/00.json} (100%) rename tests/res/{multi_load/basics/00 => 1/api/multi_load/multi_types/10}/o/00.json (100%) rename tests/res/{ => 1/api}/multi_load/query/00_00/00.json (100%) rename tests/res/{ => 1/api}/multi_load/query/00_00/10.json (100%) rename tests/res/{ => 1/api}/multi_load/query/00_00/20.json (100%) rename tests/res/{ => 1/api}/multi_load/query/00_00/30.json (100%) rename tests/res/{ => 1/api}/multi_load/query/00_00/40.json (100%) rename tests/res/{dicts/get/10/e/20.json => 1/api/multi_load/query/00_00/e/00.json} (100%) rename tests/res/{multi_load/multi_types/10 => 1/api/multi_load/query/00_00}/o/00.json (100%) rename tests/res/{json/query/q/00_00.txt => 1/api/multi_load/query/00_00/q/00.txt} (100%) rename tests/res/{ => 1/api}/multi_load/query/00_10/00.json (100%) rename tests/res/{ => 1/api}/multi_load/query/00_10/10.json (100%) rename tests/res/{ => 1/api}/multi_load/query/00_10/20.json (100%) rename tests/res/{ => 1/api}/multi_load/query/00_10/30.json (100%) rename tests/res/{ => 1/api}/multi_load/query/00_10/40.json (100%) rename tests/res/{cli/single_input/20/r/10.json => 1/api/multi_load/query/00_10/e/00.json} (100%) rename tests/res/{multi_load/query/00_00 => 1/api/multi_load/query/00_10}/o/00.json (100%) rename tests/res/{json/primitives/30.json => 1/api/multi_load/query/00_10/q/00.txt} (100%) rename tests/res/{ => 1/api}/multi_load/query/10_10/00.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_10/10.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_10/20.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_10/30.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_10/40.json (100%) rename tests/res/{dicts/get/20/e/40.py => 1/api/multi_load/query/10_10/e/00.json} (100%) rename tests/res/{multi_load/query/00_10 => 1/api/multi_load/query/10_10}/o/00.json (100%) rename tests/res/{json/primitives/e/30.txt => 1/api/multi_load/query/10_10/q/00.txt} (100%) rename tests/res/{ => 1/api}/multi_load/query/10_20/00.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_20/10.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_20/20.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_20/30.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_20/40.json (100%) rename tests/res/{multi_load/query/10_20/e/exp.json => 1/api/multi_load/query/10_20/e/00.json} (100%) rename tests/res/{multi_load/query/10_10 => 1/api/multi_load/query/10_20}/o/00.json (100%) rename tests/res/{json/query/q/10_20.txt => 1/api/multi_load/query/10_20/q/00.txt} (100%) rename tests/res/{ => 1/api}/multi_load/query/10_30/00.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_30/10.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_30/20.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_30/30.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_30/40.json (100%) rename tests/res/{cli/single_input/20/r/20.json => 1/api/multi_load/query/10_30/e/00.json} (100%) rename tests/res/{multi_load/query/10_20 => 1/api/multi_load/query/10_30}/o/00.json (100%) rename tests/res/{json/query/q/10_30.txt => 1/api/multi_load/query/10_30/q/00.txt} (100%) rename tests/res/{ => 1/api}/multi_load/query/10_40/00.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_40/10.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_40/20.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_40/30.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_40/40.json (100%) rename tests/res/{json/query/e/10_40.json => 1/api/multi_load/query/10_40/e/00.json} (100%) rename tests/res/{multi_load/query/10_30 => 1/api/multi_load/query/10_40}/o/00.json (100%) rename tests/res/{json/query/q/10_40.txt => 1/api/multi_load/query/10_40/q/00.txt} (100%) rename tests/res/{ => 1/api}/multi_load/query/10_50/00.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_50/10.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_50/20.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_50/30.json (100%) rename tests/res/{ => 1/api}/multi_load/query/10_50/40.json (100%) rename tests/res/{dicts/mk_nested_dic/10/q/10.py => 1/api/multi_load/query/10_50/e/00.json} (100%) rename tests/res/{multi_load/query/10_40 => 1/api/multi_load/query/10_50}/o/00.json (100%) rename tests/res/{json/query/q/10_50.txt => 1/api/multi_load/query/10_50/q/00.txt} (100%) rename tests/res/{ => 1/api}/multi_load/query/20_00/00.json (100%) rename tests/res/{ => 1/api}/multi_load/query/20_00/10.json (100%) rename tests/res/{ => 1/api}/multi_load/query/20_00/20.json (100%) rename tests/res/{ => 1/api}/multi_load/query/20_00/30.json (100%) rename tests/res/{ => 1/api}/multi_load/query/20_00/40.json (100%) rename tests/res/{dicts/get/30/e/20.json => 1/api/multi_load/query/20_00/e/00.json} (100%) rename tests/res/{multi_load/query/10_50 => 1/api/multi_load/query/20_00}/o/00.json (100%) rename tests/res/{single_load/query/10/q/00_00.txt => 1/api/multi_load/query/20_00/q/00.txt} (100%) rename tests/res/{ => 1/api}/multi_load/query/20_10/00.json (100%) rename tests/res/{ => 1/api}/multi_load/query/20_10/10.json (100%) rename tests/res/{ => 1/api}/multi_load/query/20_10/20.json (100%) rename tests/res/{ => 1/api}/multi_load/query/20_10/30.json (100%) rename tests/res/{ => 1/api}/multi_load/query/20_10/40.json (100%) rename tests/res/{json/primitives/20.json => 1/api/multi_load/query/20_10/e/00.json} (100%) rename tests/res/{multi_load/query/20_00 => 1/api/multi_load/query/20_10}/o/00.json (100%) rename tests/res/{json/query/q/20_10.txt => 1/api/multi_load/query/20_10/q/00.txt} (100%) rename tests/res/{ => 1/api}/multi_load/query/20_20/00.json (100%) rename tests/res/{ => 1/api}/multi_load/query/20_20/10.json (100%) rename tests/res/{ => 1/api}/multi_load/query/20_20/20.json (100%) rename tests/res/{ => 1/api}/multi_load/query/20_20/30.json (100%) rename tests/res/{ => 1/api}/multi_load/query/20_20/40.json (100%) rename tests/res/{dicts/get/30/e/30.json => 1/api/multi_load/query/20_20/e/00.json} (100%) rename tests/res/{multi_load/query/20_10 => 1/api/multi_load/query/20_20}/o/00.json (100%) rename tests/res/{json/query/q/20_20.txt => 1/api/multi_load/query/20_20/q/00.txt} (100%) rename tests/res/{multi_load/basics => 1/api/multi_load/schema}/00/00.json (100%) rename tests/res/{ => 1/api}/multi_load/schema/00/10.json (100%) rename tests/res/{ => 1/api}/multi_load/schema/00/20.json (100%) rename tests/res/{ => 1/api}/multi_load/schema/00/30.json (100%) rename tests/res/{ => 1/api}/multi_load/schema/00/40.json (100%) rename tests/res/{multi_load/basics/00/e/exp.json => 1/api/multi_load/schema/00/e/00.json} (100%) rename tests/res/{multi_load/query/20_20 => 1/api/multi_load/schema/00}/o/00.json (100%) rename tests/res/{json/basic/schema/20.json => 1/api/multi_load/schema/00/s/00.json} (100%) rename tests/res/{ => 1/api}/multi_load/template/00/00.json (100%) rename tests/res/{ => 1/api}/multi_load/template/00/30.json (100%) rename tests/res/{ => 1/api}/multi_load/template/00/c/00.json (100%) rename tests/res/{multi_load/template/00/e/exp.json => 1/api/multi_load/template/00/e/00.json} (100%) rename tests/res/{ => 1/api}/multi_load/template/00/o/00.json (100%) rename tests/res/{json/template => 1/api/multi_load/template/10}/00.json (100%) rename tests/res/{ => 1/api}/multi_load/template/10/10.json (100%) rename tests/res/{ => 1/api}/multi_load/template/10/20.json (100%) rename tests/res/{ => 1/api}/multi_load/template/10/30.json (100%) rename tests/res/{ => 1/api}/multi_load/template/10/c/00.json (100%) rename tests/res/{multi_load/schema/00/e/exp.json => 1/api/multi_load/template/10/e/00.json} (100%) rename tests/res/{ => 1/api}/multi_load/template/10/o/00.json (100%) rename tests/res/{ => 1/api}/multi_load/template/20/00.json (100%) rename tests/res/{ => 1/api}/multi_load/template/20/10.json (100%) rename tests/res/{ => 1/api}/multi_load/template/20/20.json (100%) rename tests/res/{ => 1/api}/multi_load/template/20/30.json (100%) rename tests/res/{multi_load/template/20/e/exp.json => 1/api/multi_load/template/20/e/00.json} (100%) rename tests/res/{ => 1/api}/multi_load/template/20/o (100%) create mode 120000 tests/res/1/api/open/basics rename tests/res/{ => 1/api}/single_load/ac_parser/10/00.conf (100%) rename tests/res/{ => 1/api}/single_load/ac_parser/10/10.conf (100%) rename tests/res/{ => 1/api}/single_load/ac_parser/10/20.conf (100%) rename tests/res/{ => 1/api}/single_load/ac_parser/10/e (100%) rename tests/res/{ => 1/api}/single_load/ac_parser/10/o/00.json (100%) rename tests/res/{dumps/basics/20 => 1/api/single_load/ac_parser/10}/o/10.json (100%) rename tests/res/{dumps/basics/20 => 1/api/single_load/ac_parser/10}/o/20.json (100%) rename tests/res/{multi_load/schema/00 => 1/api/single_load/basics/10}/00.json (100%) rename tests/res/{json/basic => 1/api/single_load/basics/10}/10.json (100%) rename tests/res/{ => 1/api}/single_load/basics/10/20.json (100%) rename tests/res/{ => 1/api}/single_load/basics/10/e/00.py (100%) rename tests/res/{ => 1/api}/single_load/basics/10/e/10.py (100%) rename tests/res/{ => 1/api}/single_load/basics/10/e/20.py (100%) rename tests/res/{ => 1/api}/single_load/basics/20/00.json (100%) rename tests/res/{cli/single_input => 1/api/single_load/basics}/20/10.json (100%) rename tests/res/{ => 1/api}/single_load/basics/20/20.json (100%) rename tests/res/{dicts/get => 1/api/single_load/basics}/20/e/00.json (100%) rename tests/res/{cli/show/10/o => 1/api/single_load/basics/20/e}/10.json (100%) rename tests/res/{cli/show/10/o => 1/api/single_load/basics/20/e}/20.json (100%) rename tests/res/{ => 1/api}/single_load/basics/30/00.json (100%) rename tests/res/{cli/single_input => 1/api/single_load/basics}/30/10.json (100%) rename tests/res/{ => 1/api}/single_load/basics/30/20.json (100%) rename tests/res/{single_load/basics/20 => 1/api/single_load/basics/30}/e/00.json (100%) rename tests/res/{cli/show/20/o => 1/api/single_load/basics/30/e}/10.json (100%) rename tests/res/{cli/show/20/o => 1/api/single_load/basics/30/e}/20.json (100%) rename tests/res/{ => 1/api}/single_load/basics/30/o/00.json (100%) rename tests/res/{loads/basics/10 => 1/api/single_load/basics/30}/o/10.json (100%) rename tests/res/{loads/basics/10 => 1/api/single_load/basics/30}/o/20.json (100%) rename tests/res/{ => 1/api}/single_load/multi_types/10/10.ini (100%) rename tests/res/{ => 1/api}/single_load/multi_types/10/20.properties (100%) rename tests/res/{ => 1/api}/single_load/multi_types/10/e/10.json (100%) rename tests/res/{ => 1/api}/single_load/multi_types/10/e/20.json (100%) rename tests/res/{shellvars => 1/api/single_load/multi_types/20}/10.sh (100%) rename tests/res/{shellvars => 1/api/single_load/multi_types/20}/e/10.json (100%) rename tests/res/{ => 1/api}/single_load/multi_types/20/o/10.json (100%) rename tests/res/{ => 1/api}/single_load/multi_types/30/00.xml (100%) rename tests/res/{ => 1/api}/single_load/multi_types/30/10.xml (100%) rename tests/res/{ => 1/api}/single_load/multi_types/30/20.xml (100%) rename tests/res/{ => 1/api}/single_load/multi_types/30/e/00.json (100%) rename tests/res/{ => 1/api}/single_load/multi_types/30/e/10.json (100%) rename tests/res/{ => 1/api}/single_load/multi_types/30/e/20.json (100%) rename tests/res/{json/primitives => 1/api/single_load/primitives/10}/10.json (100%) rename tests/res/{ => 1/api}/single_load/primitives/10/20.json (100%) rename tests/res/{ => 1/api}/single_load/primitives/10/30.json (100%) rename tests/res/{json/primitives => 1/api/single_load/primitives/10}/40.json (100%) rename tests/res/{ => 1/api}/single_load/primitives/10/e/10.py (100%) rename tests/res/{ => 1/api}/single_load/primitives/10/e/20.py (100%) rename tests/res/{ => 1/api}/single_load/primitives/10/e/30.py (100%) rename tests/res/{ => 1/api}/single_load/primitives/10/e/40.py (100%) rename tests/res/{ => 1/api}/single_load/query/10/00_00.json (100%) rename tests/res/{ => 1/api}/single_load/query/10/00_10.json (100%) rename tests/res/{ => 1/api}/single_load/query/10/10_00.json (100%) rename tests/res/{ => 1/api}/single_load/query/10/10_10.json (100%) rename tests/res/{ => 1/api}/single_load/query/10/10_20.json (100%) rename tests/res/{ => 1/api}/single_load/query/10/10_30.json (100%) rename tests/res/{single_load/schema/10/10.json => 1/api/single_load/query/10/10_40.json} (100%) create mode 120000 tests/res/1/api/single_load/query/10/10_50.json rename tests/res/{ => 1/api}/single_load/query/10/20_00.json (100%) rename tests/res/{ => 1/api}/single_load/query/10/20_10.json (100%) rename tests/res/{ => 1/api}/single_load/query/10/20_20.json (100%) rename tests/res/{json/query => 1/api/single_load/query/10}/e/00_00.json (100%) rename tests/res/{json/query => 1/api/single_load/query/10}/e/00_10.json (100%) rename tests/res/{loads/query/10/o => 1/api/single_load/query/10/e}/10_00.json (100%) rename tests/res/{json/query => 1/api/single_load/query/10}/e/10_10.json (100%) rename tests/res/{json/query => 1/api/single_load/query/10}/e/10_20.json (100%) rename tests/res/{json/query => 1/api/single_load/query/10}/e/10_30.json (100%) rename tests/res/{ => 1/api}/single_load/query/10/e/10_40.json (100%) rename tests/res/{json/query => 1/api/single_load/query/10}/e/10_50.json (100%) rename tests/res/{ => 1/api}/single_load/query/10/e/20_00.json (100%) rename tests/res/{json/query => 1/api/single_load/query/10}/e/20_10.json (100%) rename tests/res/{json/query => 1/api/single_load/query/10}/e/20_20.json (100%) create mode 100644 tests/res/1/api/single_load/query/10/q/00_00.txt rename tests/res/{json/query => 1/api/single_load/query/10}/q/00_10.txt (100%) rename tests/res/{json/query => 1/api/single_load/query/10}/q/10_00.txt (100%) rename tests/res/{json/query => 1/api/single_load/query/10}/q/10_10.txt (100%) rename tests/res/{ => 1/api}/single_load/query/10/q/10_20.txt (100%) rename tests/res/{ => 1/api}/single_load/query/10/q/10_30.txt (100%) rename tests/res/{ => 1/api}/single_load/query/10/q/10_40.txt (100%) rename tests/res/{ => 1/api}/single_load/query/10/q/10_50.txt (100%) rename tests/res/{json/query => 1/api/single_load/query/10}/q/20_00.txt (100%) rename tests/res/{ => 1/api}/single_load/query/10/q/20_10.txt (100%) rename tests/res/{ => 1/api}/single_load/query/10/q/20_20.txt (100%) rename tests/res/{ => 1/api}/single_load/schema/10/00.json (100%) create mode 120000 tests/res/1/api/single_load/schema/10/10.json rename tests/res/{ => 1/api}/single_load/schema/10/20.json (100%) rename tests/res/{ => 1/api}/single_load/schema/10/e (100%) rename tests/res/{json/basic/schema => 1/api/single_load/schema/10/s}/00.json (100%) rename tests/res/{json/basic/schema => 1/api/single_load/schema/10/s}/10.json (100%) rename tests/res/{ => 1/api}/single_load/schema/10/s/20.json (100%) rename tests/res/{ => 1/api}/single_load/template/00/00.j2 (100%) rename tests/res/{ => 1/api}/single_load/template/00/10.j2 (100%) rename tests/res/{ => 1/api}/single_load/template/00/20.j2 (100%) rename tests/res/{ => 1/api}/single_load/template/00/c/00.json (100%) rename tests/res/{ => 1/api}/single_load/template/00/c/10.json (100%) rename tests/res/{ => 1/api}/single_load/template/00/c/20.json (100%) rename tests/res/{ => 1/api}/single_load/template/00/e/00.json (100%) rename tests/res/{ => 1/api}/single_load/template/00/e/10.json (100%) rename tests/res/{ => 1/api}/single_load/template/00/e/20.json (100%) rename tests/res/{ => 1/api}/single_load/template/00/o/00.json (100%) rename tests/res/{loads/template/10 => 1/api/single_load/template/00}/o/10.json (100%) rename tests/res/{loads/template/10 => 1/api/single_load/template/00}/o/20.json (100%) rename tests/res/{ => 1/api}/single_load/template/10/00.j2 (100%) rename tests/res/{ => 1/api}/single_load/template/10/10.j2 (100%) rename tests/res/{ => 1/api}/single_load/template/10/20.j2 (100%) rename tests/res/{ => 1/api}/single_load/template/10/30.j2 (100%) rename tests/res/{ => 1/api}/single_load/template/10/c/00.json (100%) rename tests/res/{ => 1/api}/single_load/template/10/c/10.json (100%) rename tests/res/{ => 1/api}/single_load/template/10/c/20.json (100%) rename tests/res/{ => 1/api}/single_load/template/10/c/30.json (100%) rename tests/res/{ => 1/api}/single_load/template/10/e/00.json (100%) rename tests/res/{ => 1/api}/single_load/template/10/e/10.json (100%) rename tests/res/{cli/multi_inputs/10 => 1/api/single_load/template/10/e}/20.json (100%) rename tests/res/{parser/list/10/o => 1/api/single_load/template/10/e}/30.json (100%) rename tests/res/{ => 1/api}/single_load/template/10/o/00.json (100%) rename tests/res/{parser/list => 1/api/single_load/template}/10/o/10.json (100%) rename tests/res/{parser/list => 1/api/single_load/template}/10/o/20.json (100%) rename tests/res/{single_load/template/10/e => 1/api/single_load/template/10/o}/30.json (100%) rename tests/res/{ => 1/api}/single_load/template/20/00.j2 (100%) rename tests/res/{ => 1/api}/single_load/template/20/10.j2 (100%) rename tests/res/{ => 1/api}/single_load/template/20/20.j2 (100%) rename tests/res/{ => 1/api}/single_load/template/20/c/00.json (100%) rename tests/res/{ => 1/api}/single_load/template/20/c/10.json (100%) rename tests/res/{ => 1/api}/single_load/template/20/c/20.json (100%) rename tests/res/{ => 1/api}/single_load/template/20/e (100%) rename tests/res/{ => 1/api}/single_load/template/20/o/00.json (100%) rename tests/res/{single_load/ac_parser/10 => 1/api/single_load/template/20}/o/10.json (100%) rename tests/res/{single_load/ac_parser/10 => 1/api/single_load/template/20}/o/20.json (100%) rename tests/res/{ => 1/api}/single_load/toml/10/00.toml (100%) rename tests/res/{ => 1/api}/single_load/toml/10/10.toml (100%) rename tests/res/{ => 1/api}/single_load/toml/10/20.toml (100%) rename tests/res/{single_load/basics/10 => 1/api/single_load/toml/10/e}/00.json (100%) rename tests/res/{single_load/basics/10 => 1/api/single_load/toml/10/e}/10.json (100%) rename tests/res/{ => 1/api}/single_load/toml/10/e/20.json (100%) rename tests/res/{ => 1/api}/single_load/yaml/10/00.yml (100%) rename tests/res/{ => 1/api}/single_load/yaml/10/10.yml (100%) rename tests/res/{ => 1/api}/single_load/yaml/10/20.yml (100%) rename tests/res/{single_load/toml => 1/api/single_load/yaml}/10/e/00.json (100%) rename tests/res/{single_load/toml => 1/api/single_load/yaml}/10/e/10.json (100%) rename tests/res/{ => 1/api}/single_load/yaml/10/e/20.json (100%) rename tests/res/{ => 1}/cli/basics/10/10.json (100%) rename tests/res/{ => 1}/cli/basics/10/e/10.json (100%) rename tests/res/{ => 1}/cli/basics/10/o/10.json (100%) rename tests/res/{ => 1}/cli/errors/10/10.json (100%) rename tests/res/{ => 1}/cli/errors/10/20.json (100%) rename tests/res/{ => 1}/cli/errors/10/30.json (100%) rename tests/res/{ => 1}/cli/errors/10/40.json (100%) rename tests/res/{ => 1}/cli/errors/10/50.json (100%) rename tests/res/{ => 1}/cli/errors/10/e/10.json (100%) rename tests/res/{ => 1}/cli/errors/10/e/20.json (100%) rename tests/res/{ => 1}/cli/errors/10/e/30.json (100%) rename tests/res/{ => 1}/cli/errors/10/e/40.json (100%) rename tests/res/{ => 1}/cli/errors/10/e/50.json (100%) rename tests/res/{ => 1}/cli/errors/10/o/10.json (100%) rename tests/res/{ => 1}/cli/errors/10/o/20.json (100%) rename tests/res/{ => 1}/cli/errors/10/o/30.json (100%) rename tests/res/{ => 1}/cli/errors/10/o/40.json (100%) rename tests/res/{ => 1}/cli/errors/10/o/50.json (100%) rename tests/res/{ => 1}/cli/extra_options/10/10.json (100%) rename tests/res/{ => 1}/cli/extra_options/10/e/10.json (100%) rename tests/res/{ => 1}/cli/extra_options/10/o/10.json (100%) rename tests/res/{ => 1}/cli/extra_options/10/on/10.json (100%) rename tests/res/{ => 1}/cli/extra_options/10/r/10.json (100%) rename tests/res/{ => 1}/cli/ignore_missing/10/10.json (100%) rename tests/res/{ => 1}/cli/ignore_missing/10/e/10.json (100%) rename tests/res/{ => 1}/cli/ignore_missing/10/o/10.json (100%) rename tests/res/{ => 1}/cli/ignore_missing/10/on/10.json (100%) rename tests/res/{ => 1}/cli/ignore_missing/10/r/10.json (100%) rename tests/res/{ => 1}/cli/multi_inputs/10/10.json (100%) rename tests/res/{single_load/template/10/e => 1/cli/multi_inputs/10}/20.json (100%) rename tests/res/{ => 1}/cli/multi_inputs/10/30.json (100%) rename tests/res/{ => 1}/cli/multi_inputs/10/e/10.json (100%) rename tests/res/{ => 1}/cli/multi_inputs/10/o/10.json (100%) rename tests/res/{ => 1}/cli/multi_inputs/10/on/10.json (100%) rename tests/res/{ => 1}/cli/multi_inputs/10/r/10.json (100%) rename tests/res/{ => 1}/cli/multi_inputs/20/10.json (100%) rename tests/res/{ => 1}/cli/multi_inputs/20/20.xml (100%) rename tests/res/{ => 1}/cli/multi_inputs/20/30.sh (100%) rename tests/res/{ => 1}/cli/multi_inputs/20/e/10.json (100%) rename tests/res/{ => 1}/cli/multi_inputs/20/o/10.json (100%) rename tests/res/{ => 1}/cli/multi_inputs/20/on/10.json (100%) rename tests/res/{ => 1}/cli/multi_inputs/20/r/10.json (100%) rename tests/res/{ => 1}/cli/no_template/10/10.json (100%) rename tests/res/{ => 1}/cli/no_template/10/o/10.json (100%) rename tests/res/{ => 1}/cli/no_template/10/on/10.json (100%) rename tests/res/{ => 1}/cli/no_template/10/r/10.json (100%) rename tests/res/{ => 1}/cli/query/10/10.json (100%) rename tests/res/{ => 1}/cli/query/10/e/10.json (100%) rename tests/res/{ => 1}/cli/query/10/o/10.json (100%) rename tests/res/{ => 1}/cli/query/10/on/10.json (100%) rename tests/res/{ => 1}/cli/query/10/r/10.json (100%) create mode 120000 tests/res/1/cli/schema/10/00.json create mode 120000 tests/res/1/cli/schema/10/10.json create mode 120000 tests/res/1/cli/schema/10/20.json rename tests/res/{cli/schema/10/e/10.json => 1/cli/schema/10/e/00.json} (100%) rename tests/res/{single_load/basics/30/o => 1/cli/schema/10/e}/10.json (100%) rename tests/res/{single_load/basics/30/o => 1/cli/schema/10/e}/20.json (100%) rename tests/res/{cli/schema_errors/10/o/10.json => 1/cli/schema/10/o/00.json} (100%) rename tests/res/{single_load/template/00 => 1/cli/schema/10}/o/10.json (100%) rename tests/res/{single_load/template/00 => 1/cli/schema/10}/o/20.json (100%) rename tests/res/{cli/single_input/10 => 1/cli/schema/10/o}/30.json (100%) create mode 120000 tests/res/1/cli/schema/10/s rename tests/res/{ => 1}/cli/schema_errors/10/10.json (100%) rename tests/res/{ => 1}/cli/schema_errors/10/e/10.json (100%) create mode 100644 tests/res/1/cli/schema_errors/10/o/10.json rename tests/res/{ => 1}/cli/show/10/10.json (100%) rename tests/res/{ => 1}/cli/show/10/20.json (100%) rename tests/res/{ => 1}/cli/show/10/30.json (100%) rename tests/res/{ => 1}/cli/show/10/40.json (100%) rename tests/res/{ => 1}/cli/show/10/e/10.json (100%) rename tests/res/{ => 1}/cli/show/10/e/20.json (100%) rename tests/res/{ => 1}/cli/show/10/e/30.json (100%) rename tests/res/{ => 1}/cli/show/10/e/40.json (100%) rename tests/res/{cli/show_version => 1/cli/show}/10/o/10.json (100%) rename tests/res/{single_load/basics/20/e => 1/cli/show/10/o}/20.json (100%) rename tests/res/{ => 1}/cli/show/10/o/30.json (100%) rename tests/res/{ => 1}/cli/show/10/o/40.json (100%) rename tests/res/{ => 1}/cli/show/20/10.json (100%) rename tests/res/{ => 1}/cli/show/20/20.json (100%) rename tests/res/{ => 1}/cli/show/20/e/10.json (100%) rename tests/res/{ => 1}/cli/show/20/e/20.json (100%) rename tests/res/{cli/single_input/10/r => 1/cli/show/20/o}/10.json (100%) rename tests/res/{single_load/basics/30/e => 1/cli/show/20/o}/20.json (100%) rename tests/res/{ => 1}/cli/show_version/10/10.json (100%) rename tests/res/{ => 1}/cli/show_version/10/e/10.json (100%) rename tests/res/{cli/single_input_to_yaml_output/10/r => 1/cli/show_version/10/o}/10.json (100%) rename tests/res/{ => 1}/cli/single_input/10/10.json (100%) rename tests/res/{ => 1}/cli/single_input/10/20.conf (100%) rename tests/res/{cli/single_input/10/e => 1/cli/single_input/10}/30.json (100%) rename tests/res/{ => 1}/cli/single_input/10/e/10.json (100%) rename tests/res/{cli/schema/10 => 1/cli/single_input/10/e}/20.json (100%) rename tests/res/{cli/single_input/10/r => 1/cli/single_input/10/e}/30.json (100%) rename tests/res/{ => 1}/cli/single_input/10/o/10.json (100%) rename tests/res/{ => 1}/cli/single_input/10/o/20.json (100%) rename tests/res/{ => 1}/cli/single_input/10/o/30.json (100%) rename tests/res/{ => 1}/cli/single_input/10/on/10.json (100%) rename tests/res/{cli/single_input/10/e => 1/cli/single_input/10/on}/20.json (100%) rename tests/res/{ => 1}/cli/single_input/10/on/30.json (100%) rename tests/res/{ => 1}/cli/single_input/10/oo/10.json (100%) rename tests/res/{cli/single_input/10/on => 1/cli/single_input/10/oo}/20.json (100%) rename tests/res/{ => 1}/cli/single_input/10/oo/30.json (100%) rename tests/res/{dicts/get/10/e => 1/cli/single_input/10/r}/10.json (100%) rename tests/res/{cli/single_input/10/oo => 1/cli/single_input/10/r}/20.json (100%) rename tests/res/{cli/single_input/20 => 1/cli/single_input/10/r}/30.json (100%) rename tests/res/{cli/single_input/40 => 1/cli/single_input/20}/10.json (100%) rename tests/res/{cli/single_input/10/r => 1/cli/single_input/20}/20.json (100%) rename tests/res/{cli/single_input/20/on => 1/cli/single_input/20}/30.json (100%) rename tests/res/{ => 1}/cli/single_input/20/e/10.json (100%) rename tests/res/{cli/single_input/20 => 1/cli/single_input/20/e}/20.json (100%) rename tests/res/{ => 1}/cli/single_input/20/e/30.json (100%) rename tests/res/{ => 1}/cli/single_input/20/o/10.json (100%) rename tests/res/{ => 1}/cli/single_input/20/o/20.json (100%) rename tests/res/{ => 1}/cli/single_input/20/o/30.json (100%) rename tests/res/{ => 1}/cli/single_input/20/on/10.json (100%) rename tests/res/{cli/single_input/20/e => 1/cli/single_input/20/on}/20.json (100%) rename tests/res/{cli/single_input_to_yaml_output/10/e => 1/cli/single_input/20/on}/30.json (100%) rename tests/res/{single_load/primitives/10 => 1/cli/single_input/20/r}/10.json (100%) rename tests/res/{json/primitives/e/40.txt => 1/cli/single_input/20/r/20.json} (100%) rename tests/res/{dicts/merge/20 => 1/cli/single_input/30}/10.json (100%) rename tests/res/{cli/single_input/20/on => 1/cli/single_input/30}/20.json (100%) rename tests/res/{ => 1}/cli/single_input/30/e/10.json (100%) rename tests/res/{cli/single_input/30 => 1/cli/single_input/30/e}/20.json (100%) rename tests/res/{ => 1}/cli/single_input/30/o/10.json (100%) rename tests/res/{ => 1}/cli/single_input/30/o/20.json (100%) rename tests/res/{ => 1}/cli/single_input/30/on/10.json (100%) rename tests/res/{cli/single_input/30/e => 1/cli/single_input/30/on}/20.json (100%) rename tests/res/{ => 1}/cli/single_input/30/r/10.json (100%) rename tests/res/{ => 1}/cli/single_input/30/r/20.json (100%) rename tests/res/{dicts/merge/30 => 1/cli/single_input/40}/10.json (100%) rename tests/res/{ => 1}/cli/single_input/40/e/10.json (100%) rename tests/res/{ => 1}/cli/single_input/40/o/10.json (100%) rename tests/res/{ => 1}/cli/single_input/40/on/10.json (100%) rename tests/res/{ => 1}/cli/single_input/40/r/10.json (100%) rename tests/res/{cli/schema/10 => 1/cli/single_input/50}/10.json (100%) rename tests/res/{ => 1}/cli/single_input/50/e/10.json (100%) rename tests/res/{ => 1}/cli/single_input/50/o/10.json (100%) rename tests/res/{ => 1}/cli/single_input/50/on/10.json (100%) rename tests/res/{cli/schema/10/s => 1/cli/single_input/50/r}/10.json (100%) rename tests/res/{cli/single_input/50 => 1/cli/single_input_to_yaml_output/10}/10.json (100%) rename tests/res/{cli/single_input/30/on => 1/cli/single_input_to_yaml_output/10}/20.json (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/30.yml (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/40.yml (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/e/10.json (100%) rename tests/res/{cli/single_input_to_yaml_output/10 => 1/cli/single_input_to_yaml_output/10/e}/20.json (100%) rename tests/res/{cli/single_input_to_yaml_output/10/o => 1/cli/single_input_to_yaml_output/10/e}/30.json (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/e/40.json (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/o/10.json (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/o/20.json (100%) rename tests/res/{dicts/get/30 => 1/cli/single_input_to_yaml_output/10/o}/30.json (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/o/40.json (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/on/10.json (100%) rename tests/res/{cli/single_input_to_yaml_output/10/e => 1/cli/single_input_to_yaml_output/10/on}/20.json (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/on/30.json (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/on/40.json (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/oo/10.json (100%) rename tests/res/{cli/single_input_to_yaml_output/10/on => 1/cli/single_input_to_yaml_output/10/oo}/20.json (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/oo/30.json (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/oo/40.json (100%) rename tests/res/{single_load/basics/20/e => 1/cli/single_input_to_yaml_output/10/r}/10.json (100%) rename tests/res/{cli/single_input_to_yaml_output/10/oo => 1/cli/single_input_to_yaml_output/10/r}/20.json (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/r/30.json (100%) rename tests/res/{ => 1}/cli/single_input_to_yaml_output/10/r/40.json (100%) rename tests/res/{cli/single_input_to_yaml_output => 1/cli/template}/10/10.json (100%) rename tests/res/{ => 1}/cli/template/10/20.json (100%) rename tests/res/{ => 1}/cli/template/10/e/10.json (100%) rename tests/res/{cli/single_input_to_yaml_output/10/r => 1/cli/template/10/e}/20.json (100%) rename tests/res/{ => 1}/cli/template/10/o/10.json (100%) rename tests/res/{cli/template/10/e => 1/cli/template/10/o}/20.json (100%) rename tests/res/{ => 1}/cli/template/10/on/10.json (100%) rename tests/res/{cli/template/10/o => 1/cli/template/10/on}/20.json (100%) rename tests/res/{ => 1}/cli/template/10/r/10.json (100%) rename tests/res/{ => 1}/cli/template/10/r/20.json (100%) create mode 120000 tests/res/1/common/tdc/10/100_null.json create mode 120000 tests/res/1/common/tdc/10/e/100_null.json.py create mode 120000 tests/res/1/common/tdc/20/220_a_list.json create mode 120000 tests/res/1/common/tdc/20/e/220_a_list.json.py create mode 120000 tests/res/1/common/tdc/20/o/220_a_list.json.json rename tests/res/{ => 1}/dicts/get/10/10.json (100%) rename tests/res/{cli/template/10/on => 1/dicts/get/10}/20.json (100%) rename tests/res/{single_load/basics/30 => 1/dicts/get/10}/e/10.json (100%) rename tests/res/{single_load/query/10/e/00_00.json => 1/dicts/get/10/e/20.json} (100%) rename tests/res/{ => 1}/dicts/get/10/q/10.py (100%) rename tests/res/{ => 1}/dicts/get/10/q/20.py (100%) rename tests/res/{ => 1}/dicts/get/10/s/10.py (100%) rename tests/res/{ => 1}/dicts/get/10/s/20.py (100%) rename tests/res/{ => 1}/dicts/get/20/00.json (100%) rename tests/res/{single_load/template/10/o => 1/dicts/get/20}/10.json (100%) rename tests/res/{ => 1}/dicts/get/20/100.json (100%) rename tests/res/{ => 1}/dicts/get/20/110.json (100%) rename tests/res/{single_load/template/10/o => 1/dicts/get/20}/20.json (100%) rename tests/res/{single_load/template/10/o => 1/dicts/get/20}/30.json (100%) rename tests/res/{ => 1}/dicts/get/20/40.json (100%) rename tests/res/{ => 1}/dicts/get/20/50.json (100%) rename tests/res/{ => 1}/dicts/get/20/60.json (100%) rename tests/res/{ => 1}/dicts/get/20/70.json (100%) rename tests/res/{ => 1}/dicts/get/20/80.json (100%) rename tests/res/{ => 1}/dicts/get/20/90.json (100%) rename tests/res/{single_load/basics/30 => 1/dicts/get/20}/e/00.json (100%) rename tests/res/{ => 1}/dicts/get/20/e/10.json (100%) rename tests/res/{ => 1}/dicts/get/20/e/100.py (100%) rename tests/res/{ => 1}/dicts/get/20/e/110.py (100%) rename tests/res/{ => 1}/dicts/get/20/e/20.py (100%) rename tests/res/{ => 1}/dicts/get/20/e/30.py (100%) rename tests/res/{json/primitives/e/10.txt => 1/dicts/get/20/e/40.py} (100%) rename tests/res/{ => 1}/dicts/get/20/e/50.py (100%) rename tests/res/{ => 1}/dicts/get/20/e/60.py (100%) rename tests/res/{ => 1}/dicts/get/20/e/70.py (100%) rename tests/res/{ => 1}/dicts/get/20/e/80.py (100%) rename tests/res/{ => 1}/dicts/get/20/e/90.py (100%) rename tests/res/{ => 1}/dicts/get/20/q/00.py (100%) rename tests/res/{ => 1}/dicts/get/20/q/10.py (100%) rename tests/res/{ => 1}/dicts/get/20/q/100.py (100%) rename tests/res/{ => 1}/dicts/get/20/q/110.py (100%) rename tests/res/{ => 1}/dicts/get/20/q/20.py (100%) rename tests/res/{ => 1}/dicts/get/20/q/30.py (100%) rename tests/res/{ => 1}/dicts/get/20/q/40.py (100%) rename tests/res/{ => 1}/dicts/get/20/q/50.py (100%) rename tests/res/{ => 1}/dicts/get/20/q/60.py (100%) rename tests/res/{ => 1}/dicts/get/20/q/70.py (100%) rename tests/res/{ => 1}/dicts/get/20/q/80.py (100%) rename tests/res/{ => 1}/dicts/get/20/q/90.py (100%) rename tests/res/{ => 1}/dicts/get/20/s/00.py (100%) rename tests/res/{ => 1}/dicts/get/20/s/10.py (100%) rename tests/res/{ => 1}/dicts/get/20/s/100.py (100%) rename tests/res/{ => 1}/dicts/get/20/s/110.py (100%) rename tests/res/{ => 1}/dicts/get/20/s/20.py (100%) rename tests/res/{ => 1}/dicts/get/20/s/30.py (100%) rename tests/res/{ => 1}/dicts/get/20/s/40.py (100%) rename tests/res/{ => 1}/dicts/get/20/s/50.py (100%) rename tests/res/{ => 1}/dicts/get/20/s/60.py (100%) rename tests/res/{ => 1}/dicts/get/20/s/70.py (100%) rename tests/res/{ => 1}/dicts/get/20/s/80.py (100%) rename tests/res/{ => 1}/dicts/get/20/s/90.py (100%) rename tests/res/{ => 1}/dicts/get/30/10.json (100%) rename tests/res/{dicts/get/10 => 1/dicts/get/30}/20.json (100%) rename tests/res/{dicts/get/30/20.json => 1/dicts/get/30/30.json} (100%) rename tests/res/{ => 1}/dicts/get/30/e/10.py (100%) rename tests/res/{single_load/query/10/e/20_20.json => 1/dicts/get/30/e/20.json} (100%) create mode 100644 tests/res/1/dicts/get/30/e/30.json rename tests/res/{ => 1}/dicts/get/30/q/10.txt (100%) rename tests/res/{ => 1}/dicts/get/30/q/20.txt (100%) rename tests/res/{ => 1}/dicts/get/30/q/30.txt (100%) rename tests/res/{parser/list/10/00.txt => 1/dicts/get/30/s/10.txt} (100%) rename tests/res/{ => 1}/dicts/get/30/s/20.txt (100%) rename tests/res/{ => 1}/dicts/get/30/s/30.txt (100%) rename tests/res/{ => 1}/dicts/merge/10/10.json (100%) rename tests/res/{ => 1}/dicts/merge/10/e/10.json (100%) rename tests/res/{ => 1}/dicts/merge/10/o/10.json (100%) rename tests/res/{ => 1}/dicts/merge/10/s/10.json (100%) rename tests/res/{dicts/merge/40 => 1/dicts/merge/20}/10.json (100%) rename tests/res/{ => 1}/dicts/merge/20/e/10.json (100%) rename tests/res/{ => 1}/dicts/merge/20/o/10.json (100%) rename tests/res/{ => 1}/dicts/merge/20/s/10.json (100%) rename tests/res/{single_load/basics/20 => 1/dicts/merge/30}/10.json (100%) rename tests/res/{ => 1}/dicts/merge/30/e/10.json (100%) rename tests/res/{ => 1}/dicts/merge/30/o/10.json (100%) rename tests/res/{ => 1}/dicts/merge/30/s/10.json (100%) rename tests/res/{single_load/basics/30 => 1/dicts/merge/40}/10.json (100%) rename tests/res/{ => 1}/dicts/merge/40/e/10.json (100%) rename tests/res/{ => 1}/dicts/merge/40/o/10.json (100%) rename tests/res/{ => 1}/dicts/merge/40/s/10.json (100%) rename tests/res/{ => 1}/dicts/mk_nested_dic/10/10.py (100%) rename tests/res/{ => 1}/dicts/mk_nested_dic/10/20.py (100%) rename tests/res/{ => 1}/dicts/mk_nested_dic/10/e/10.json (100%) rename tests/res/{ => 1}/dicts/mk_nested_dic/10/e/20.json (100%) rename tests/res/{ => 1}/dicts/mk_nested_dic/10/o/10.json (100%) rename tests/res/{ => 1}/dicts/mk_nested_dic/10/o/20.json (100%) rename tests/res/{single_load/query/10/e/00_10.json => 1/dicts/mk_nested_dic/10/q/10.py} (100%) rename tests/res/{ => 1}/dicts/mk_nested_dic/10/q/20.py (100%) rename tests/res/{single_load/basics/20/test_cases_with_schema_validation.txt => 1/parser/attrlist/10/00.txt} (100%) rename tests/res/{ => 1}/parser/attrlist/10/10.txt (100%) rename tests/res/{ => 1}/parser/attrlist/10/20.txt (100%) rename tests/res/{ => 1}/parser/attrlist/10/30.txt (100%) rename tests/res/{ => 1}/parser/attrlist/10/40.txt (100%) rename tests/res/{multi_load/schema/00/o => 1/parser/attrlist/10/e}/00.json (100%) rename tests/res/{ => 1}/parser/attrlist/10/e/10.json (100%) rename tests/res/{ => 1}/parser/attrlist/10/e/20.json (100%) rename tests/res/{ => 1}/parser/attrlist/10/e/30.json (100%) rename tests/res/{ => 1}/parser/attrlist/10/e/40.json (100%) rename tests/res/{ => 1}/parser/attrlist_0/10/00.txt (100%) rename tests/res/{ => 1}/parser/attrlist_0/10/10.txt (100%) rename tests/res/{ => 1}/parser/attrlist_0/10/20.txt (100%) rename tests/res/{ => 1}/parser/attrlist_0/10/30.txt (100%) rename tests/res/{ => 1}/parser/attrlist_0/10/40.txt (100%) rename tests/res/{ => 1}/parser/attrlist_0/10/e/00.json (100%) rename tests/res/{ => 1}/parser/attrlist_0/10/e/10.py (100%) rename tests/res/{ => 1}/parser/attrlist_0/10/e/20.py (100%) rename tests/res/{ => 1}/parser/attrlist_0/10/e/30.py (100%) rename tests/res/{ => 1}/parser/attrlist_0/10/e/40.py (100%) rename tests/res/{single_load/basics/30/test_cases_with_explicit_parser_type_option.txt => 1/parser/list/10/00.txt} (100%) rename tests/res/{ => 1}/parser/list/10/10.txt (100%) rename tests/res/{ => 1}/parser/list/10/20.txt (100%) rename tests/res/{ => 1}/parser/list/10/30.txt (100%) rename tests/res/{ => 1}/parser/list/10/40.txt (100%) rename tests/res/{ => 1}/parser/list/10/50.txt (100%) rename tests/res/{ => 1}/parser/list/10/e/00.json (100%) rename tests/res/{ => 1}/parser/list/10/e/10.json (100%) rename tests/res/{ => 1}/parser/list/10/e/20.json (100%) rename tests/res/{ => 1}/parser/list/10/e/30.json (100%) rename tests/res/{ => 1}/parser/list/10/e/40.json (100%) rename tests/res/{ => 1}/parser/list/10/e/50.json (100%) rename tests/res/{parser/attrlist/10/e => 1/parser/list/10/o}/00.json (100%) rename tests/res/{single_load/template/20 => 1/parser/list/10}/o/10.json (100%) rename tests/res/{single_load/template/20 => 1/parser/list/10}/o/20.json (100%) rename tests/res/{parser/list/10/o/40.json => 1/parser/list/10/o/30.json} (100%) create mode 120000 tests/res/1/parser/list/10/o/40.json rename tests/res/{ => 1}/parser/list/10/o/50.json (100%) rename tests/res/{ => 1}/parser/parse/10/00.py (100%) rename tests/res/{ => 1}/parser/parse/10/10.txt (100%) rename tests/res/{ => 1}/parser/parse/10/20.txt (100%) rename tests/res/{ => 1}/parser/parse/10/30.txt (100%) rename tests/res/{ => 1}/parser/parse/10/40.py (100%) rename tests/res/{ => 1}/parser/parse/10/50.py (100%) rename tests/res/{ => 1}/parser/parse/10/60.txt (100%) rename tests/res/{ => 1}/parser/parse/10/70.txt (100%) rename tests/res/{ => 1}/parser/parse/10/e (100%) rename tests/res/{ => 1}/parser/parse/20/20.txt (100%) rename tests/res/{ => 1}/parser/parse/20/30.txt (100%) rename tests/res/{ => 1}/parser/parse/20/40.txt (100%) rename tests/res/{ => 1}/parser/parse/20/e (100%) rename tests/res/{ => 1}/parser/parse/30/10.txt (100%) rename tests/res/{ => 1}/parser/parse/30/20.txt (100%) rename tests/res/{ => 1}/parser/parse/30/30.txt (100%) rename tests/res/{ => 1}/parser/parse/30/40.txt (100%) rename tests/res/{ => 1}/parser/parse/30/e (100%) rename tests/res/{ => 1}/parser/single/10/00.py (100%) rename tests/res/{ => 1}/parser/single/10/10.txt (100%) rename tests/res/{ => 1}/parser/single/10/20.txt (100%) rename tests/res/{ => 1}/parser/single/10/30.txt (100%) rename tests/res/{ => 1}/parser/single/10/40.py (100%) rename tests/res/{ => 1}/parser/single/10/50.py (100%) rename tests/res/{ => 1}/parser/single/10/60.txt (100%) rename tests/res/{ => 1}/parser/single/10/70.txt (100%) rename tests/res/{ => 1}/parser/single/10/e/00.py (100%) rename tests/res/{ => 1}/parser/single/10/e/10.py (100%) rename tests/res/{ => 1}/parser/single/10/e/20.py (100%) rename tests/res/{ => 1}/parser/single/10/e/30.py (100%) rename tests/res/{ => 1}/parser/single/10/e/40.py (100%) rename tests/res/{ => 1}/parser/single/10/e/50.py (100%) rename tests/res/{ => 1}/parser/single/10/e/60.py (100%) rename tests/res/{ => 1}/parser/single/10/e/70.py (100%) delete mode 100644 tests/res/cli/errors/10/README.md delete mode 100644 tests/res/cli/extra_options/10/README.md delete mode 100644 tests/res/cli/ignore_missing/10/README.md delete mode 100644 tests/res/cli/multi_inputs/10/README.md delete mode 100644 tests/res/cli/multi_inputs/10/i/10.json delete mode 100644 tests/res/cli/multi_inputs/20/README.md delete mode 100644 tests/res/cli/multi_inputs/20/i/10.json delete mode 100644 tests/res/cli/schema/10/e/20.json delete mode 100644 tests/res/cli/schema/10/s/20.json delete mode 100644 tests/res/cli/schema_errors/10/README.md delete mode 100644 tests/res/cli/show/10/README.md delete mode 100644 tests/res/cli/show/20/README.md delete mode 100644 tests/res/cli/show_version/10/README.md delete mode 100644 tests/res/cli/single_input/10/README.md delete mode 100644 tests/res/cli/single_input/30/README.md delete mode 100644 tests/res/cli/single_input/40/README.md delete mode 100644 tests/res/cli/single_input/50/README.md delete mode 100644 tests/res/cli/single_input/50/r/10.json delete mode 100644 tests/res/cli/single_input_to_yaml_output/10/README.md delete mode 120000 tests/res/cli/template/10/10.json delete mode 120000 tests/res/dump/basics/10/00.json delete mode 120000 tests/res/dump/basics/10/10.json delete mode 120000 tests/res/dump/basics/10/20.json delete mode 120000 tests/res/dump/basics/20/00.json delete mode 120000 tests/res/dump/basics/20/10.json delete mode 120000 tests/res/dump/basics/20/20.json delete mode 100644 tests/res/dump/basics/20/o/00.json delete mode 120000 tests/res/dumps/basics/10/00.json delete mode 120000 tests/res/dumps/basics/10/10.json delete mode 120000 tests/res/dumps/basics/10/20.json delete mode 120000 tests/res/dumps/basics/10/e/00.txt delete mode 120000 tests/res/dumps/basics/10/e/10.txt delete mode 120000 tests/res/dumps/basics/10/e/20.txt delete mode 120000 tests/res/dumps/basics/20/00.json delete mode 120000 tests/res/dumps/basics/20/10.json delete mode 120000 tests/res/dumps/basics/20/20.json delete mode 120000 tests/res/dumps/basics/20/e/00.txt delete mode 120000 tests/res/dumps/basics/20/e/10.txt delete mode 120000 tests/res/dumps/basics/20/e/20.txt delete mode 100644 tests/res/json/primitives/e/20.txt delete mode 120000 tests/res/json/query/00_00.json delete mode 120000 tests/res/json/query/00_10.json delete mode 120000 tests/res/json/query/10_00.json delete mode 120000 tests/res/json/query/10_10.json delete mode 120000 tests/res/json/query/10_20.json delete mode 120000 tests/res/json/query/10_30.json delete mode 120000 tests/res/json/query/10_40.json delete mode 120000 tests/res/json/query/20_00.json delete mode 120000 tests/res/json/query/20_10.json delete mode 120000 tests/res/json/query/20_20.json delete mode 100644 tests/res/json/template/10.json delete mode 100644 tests/res/json/template/20.json delete mode 120000 tests/res/json/template/ctx/00.json delete mode 120000 tests/res/json/template/ctx/10.json delete mode 120000 tests/res/json/template/ctx/20.json delete mode 120000 tests/res/json/template/e/00.json delete mode 100644 tests/res/json/template/e/10.json delete mode 120000 tests/res/json/template/e/20.json delete mode 120000 tests/res/loads/basics/10/00.txt delete mode 120000 tests/res/loads/basics/10/10.txt delete mode 120000 tests/res/loads/basics/10/20.txt delete mode 120000 tests/res/loads/query/10/00_00.txt delete mode 120000 tests/res/loads/query/10/00_10.txt delete mode 120000 tests/res/loads/query/10/10_00.txt delete mode 120000 tests/res/loads/query/10/10_10.txt delete mode 120000 tests/res/loads/query/10/10_20.txt delete mode 120000 tests/res/loads/query/10/10_30.txt delete mode 120000 tests/res/loads/query/10/10_40.txt delete mode 120000 tests/res/loads/query/10/20_00.txt delete mode 120000 tests/res/loads/query/10/20_10.txt delete mode 120000 tests/res/loads/query/10/20_20.txt delete mode 120000 tests/res/loads/query/10/e delete mode 120000 tests/res/loads/query/10/q delete mode 120000 tests/res/loads/schema/10/00.txt delete mode 120000 tests/res/loads/schema/10/10.txt delete mode 120000 tests/res/loads/schema/10/20.txt delete mode 120000 tests/res/loads/schema/10/s/00.txt delete mode 120000 tests/res/loads/schema/10/s/10.txt delete mode 120000 tests/res/loads/schema/10/s/20.txt delete mode 120000 tests/res/loads/template/10/00.txt delete mode 120000 tests/res/loads/template/10/10.txt delete mode 120000 tests/res/loads/template/10/20.txt delete mode 120000 tests/res/loads/template/10/c delete mode 120000 tests/res/loads/template/10/e delete mode 120000 tests/res/multi_load/basics/00/s/00.json delete mode 120000 tests/res/multi_load/query/00_00/e/exp.json delete mode 120000 tests/res/multi_load/query/00_00/q/q.txt delete mode 120000 tests/res/multi_load/query/00_10/e/exp.json delete mode 120000 tests/res/multi_load/query/00_10/q/q.txt delete mode 120000 tests/res/multi_load/query/10_10/e/exp.json delete mode 120000 tests/res/multi_load/query/10_10/q/q.txt delete mode 120000 tests/res/multi_load/query/10_20/q/q.txt delete mode 120000 tests/res/multi_load/query/10_30/e/exp.json delete mode 120000 tests/res/multi_load/query/10_30/q/q.txt delete mode 120000 tests/res/multi_load/query/10_40/e/exp.json delete mode 120000 tests/res/multi_load/query/10_40/q/q.txt delete mode 120000 tests/res/multi_load/query/10_50/e/exp.json delete mode 120000 tests/res/multi_load/query/10_50/q/q.txt delete mode 120000 tests/res/multi_load/query/20_00/e/exp.json delete mode 120000 tests/res/multi_load/query/20_00/q/q.txt delete mode 120000 tests/res/multi_load/query/20_10/e/exp.json delete mode 120000 tests/res/multi_load/query/20_10/q/q.txt delete mode 120000 tests/res/multi_load/query/20_20/e/exp.json delete mode 120000 tests/res/multi_load/query/20_20/q/q.txt delete mode 100644 tests/res/multi_load/template/10/00.json delete mode 100644 tests/res/multi_load/template/10/e/exp.json delete mode 120000 tests/res/open/basics/10 delete mode 100644 tests/res/parser/list/10/o/00.json delete mode 100644 tests/res/single_load/multi_types/20/10.sh delete mode 100644 tests/res/single_load/multi_types/20/e/10.json delete mode 100644 tests/res/single_load/primitives/10/40.json delete mode 120000 tests/res/single_load/query/10/e/10_00.json delete mode 120000 tests/res/single_load/query/10/e/10_10.json delete mode 100644 tests/res/single_load/query/10/e/10_20.json delete mode 100644 tests/res/single_load/query/10/e/10_30.json delete mode 100644 tests/res/single_load/query/10/e/10_50.json delete mode 100644 tests/res/single_load/query/10/e/20_10.json delete mode 100644 tests/res/single_load/query/10/q/00_10.txt delete mode 120000 tests/res/single_load/query/10/q/10_00.txt delete mode 120000 tests/res/single_load/query/10/q/10_10.txt delete mode 120000 tests/res/single_load/query/10/q/20_00.txt delete mode 100644 tests/res/single_load/schema/10/s/00.json delete mode 100644 tests/res/single_load/schema/10/s/10.json delete mode 100644 tests/res/single_load/yaml/10/e/00.json delete mode 100644 tests/res/single_load/yaml/10/e/10.json diff --git a/README.rst b/README.rst index 09222ad2..f37dbcf3 100644 --- a/README.rst +++ b/README.rst @@ -20,6 +20,10 @@ python-anyconfig :target: https://github.com/ssato/python-anyconfig/actions?query=workflow%3ATests :alt: [Github Actions: Test status] +.. image:: https://dev.azure.com/satorusatoh0471/python-anyconfig/_apis/build/status/ssato.python-anyconfig?branchName=next + :target: https://dev.azure.com/satorusatoh0471/python-anyconfig/_build/latest?definitionId=1 + :alt: [Azure Pipelines Status] + .. image:: https://img.shields.io/coveralls/ssato/python-anyconfig.svg :target: https://coveralls.io/r/ssato/python-anyconfig :alt: [Coverage Status] diff --git a/pkg/header.rst b/pkg/header.rst index 256ff04b..e0f4162f 100644 --- a/pkg/header.rst +++ b/pkg/header.rst @@ -20,6 +20,10 @@ python-anyconfig :target: https://github.com/ssato/python-anyconfig/actions?query=workflow%3ATests :alt: [Github Actions: Test status] +.. image:: https://dev.azure.com/satorusatoh0471/python-anyconfig/_apis/build/status/ssato.python-anyconfig?branchName=next + :target: https://dev.azure.com/satorusatoh0471/python-anyconfig/_build/latest?definitionId=1 + :alt: [Azure Pipelines Status] + .. image:: https://img.shields.io/coveralls/ssato/python-anyconfig.svg :target: https://coveralls.io/r/ssato/python-anyconfig :alt: [Coverage Status] diff --git a/src/anyconfig/query/__init__.py b/src/anyconfig/query/__init__.py index 76d95de4..d3ebd3d6 100644 --- a/src/anyconfig/query/__init__.py +++ b/src/anyconfig/query/__init__.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # """Public API to query data with JMESPath expression.""" @@ -14,5 +14,3 @@ __all__ = [ "try_query", ] - -# vim:sw=4:ts=4:et: diff --git a/tests/api/dump/common.py b/tests/api/dump/common.py deleted file mode 100644 index dce0f556..00000000 --- a/tests/api/dump/common.py +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring -import unittest - -from ... import base - - -class BaseTestCase(base.TDataCollector, unittest.TestCase): - target = 'dump' - -# vim:sw=4:ts=4:et: diff --git a/tests/api/dump/test_basics.py b/tests/api/dump/test_basics.py index bc53977e..91655af6 100644 --- a/tests/api/dump/test_basics.py +++ b/tests/api/dump/test_basics.py @@ -1,49 +1,59 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -import pathlib -import tempfile +"""Basic test cases for anyconfig.api.dump.""" +from __future__ import annotations + +import typing + +import pytest import anyconfig.api._dump as TT from anyconfig.api import ( - UnknownProcessorTypeError, UnknownFileTypeError + UnknownFileTypeError, UnknownProcessorTypeError ) -from . import common - - -class TestCase(common.BaseTestCase): - - def test_dump(self): - with tempfile.TemporaryDirectory() as tdir: - for data in self.each_data(): - out = pathlib.Path(tdir) / 'out.json' - TT.dump(data.inp, out, **data.opts) - self.assertEqual( - out.read_text().strip(), - data.exp.strip(), - f'{data.datadir!s}, {data.inp_path!s}' - ) - - def test_dump_intentional_failures(self): - with tempfile.TemporaryDirectory() as tdir: - for data in self.each_data(): - out = pathlib.Path(tdir) / 'out.json' - TT.dump(data.inp, out, **data.opts) - with self.assertRaises(AssertionError): - self.assertEqual(out.read_text().strip(), '') - - def test_dump_failure_ac_parser_was_not_given(self): - for data in self.each_data(): - with self.assertRaises(UnknownFileTypeError): - TT.dump(data.inp, 'dummy.txt') - - def test_dump_failure_invalid_ac_parser_was_given(self): - for data in self.each_data(): - with self.assertRaises(UnknownProcessorTypeError): - TT.dump(data.inp, 'dummy.json', ac_parser='invalid_id') - -# vim:sw=4:ts=4:et: +from ... import common + +if typing.TYPE_CHECKING: + import pathlib + + +NAMES: tuple[str, ...] = ("obj", "opts", "exp") + +# .. seealso:: tests.common.tdc +DATA_0: list = common.load_data_for_testfile(__file__, load_idata=True) +DATA_IDS: list[str] = common.get_test_ids(DATA_0) +DATA: list[tuple[typing.Any, dict, str]] = [ + (i, o, e.strip()) for _, i, o, e in DATA_0 +] + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_dump(obj, opts: dict, exp, tmp_path: pathlib.Path) -> None: + out = tmp_path / "out.json" + TT.dump(obj, out, **opts) + assert out.read_text() == exp + + +@pytest.mark.parametrize(NAMES, DATA[:1], ids=DATA_IDS[:1]) +def test_dump_without_ac_parser_option(obj, opts: dict, exp) -> None: + assert opts or exp + with pytest.raises(UnknownFileTypeError): + TT.dump(obj, "out.txt") + + +@pytest.mark.parametrize(NAMES, DATA[:1], ids=DATA_IDS[:1]) +def test_dump_with_invalid_ac_parser_option( + obj, opts: dict, exp +) -> None: + assert opts or exp + with pytest.raises(UnknownProcessorTypeError): + TT.dump(obj, "out.json", ac_parser="invalid_id") diff --git a/tests/api/dumps/common.py b/tests/api/dumps/common.py deleted file mode 100644 index cfaed0f4..00000000 --- a/tests/api/dumps/common.py +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring -import unittest - -from ... import base - - -class BaseTestCase(base.TDataCollector, unittest.TestCase): - target = 'dumps' - -# vim:sw=4:ts=4:et: diff --git a/tests/api/dumps/test_basics.py b/tests/api/dumps/test_basics.py index 9a068ec4..e4b44f35 100644 --- a/tests/api/dumps/test_basics.py +++ b/tests/api/dumps/test_basics.py @@ -1,38 +1,52 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring +"""Basic test cases for anyconfig.api.dumps.""" +from __future__ import annotations + +import typing + +import pytest + import anyconfig.api._dump as TT from anyconfig.api import UnknownProcessorTypeError -from . import common +from ... import common + + +NAMES: tuple[str, ...] = ("obj", "opts", "exp") + +# .. seealso:: tests.common.tdc +DATA_0: list = common.load_data_for_testfile(__file__, load_idata=True) +DATA_IDS: list[str] = common.get_test_ids(DATA_0) +DATA: list[tuple[typing.Any, dict, str]] = [ + (i, o, e.strip()) for _, i, o, e in DATA_0 +] + +def test_data() -> None: + assert DATA -class TestCase(common.BaseTestCase): - def test_dumps(self): - for data in self.each_data(): - self.assertEqual( - TT.dumps(data.inp, **data.opts).strip(), - data.exp.strip(), - f'{data.datadir!s}, {data.inp_path!s}' - ) +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_dumps(obj, opts: dict, exp) -> None: + assert TT.dumps(obj, **opts) == exp - def test_dumps_intentional_failures(self): - for data in self.each_data(): - with self.assertRaises(AssertionError): - self.assertEqual(TT.dumps(data.inp, **data.opts).strip(), {}) - def test_dump_failure_ac_parser_was_not_given(self): - for data in self.each_data(): - with self.assertRaises(ValueError): - TT.dumps(data.inp) +@pytest.mark.parametrize(NAMES, DATA[:1], ids=DATA_IDS[:1]) +def test_dumps_without_ac_parser_option(obj, opts: dict, exp) -> None: + assert opts or exp + with pytest.raises(ValueError): + TT.dumps(obj) - def test_dump_failure_invalid_ac_parser_was_given(self): - for data in self.each_data(): - with self.assertRaises(UnknownProcessorTypeError): - TT.dumps(data.inp, ac_parser='invalid_id') -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA[:1], ids=DATA_IDS[:1]) +def test_dumps_with_invalid_ac_parser_option( + obj, opts: dict, exp +) -> None: + assert opts or exp + with pytest.raises(UnknownProcessorTypeError): + TT.dumps(obj, ac_parser="invalid_id") diff --git a/tests/api/load/common.py b/tests/api/load/common.py index a9b625df..3be48618 100644 --- a/tests/api/load/common.py +++ b/tests/api/load/common.py @@ -1,22 +1,13 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -import anyconfig.api._load as TT - - -class Basa: - @staticmethod - def target_fn(*args, **kwargs): - return TT.load(*args, **kwargs) - - -class MultiBase: - target: str = 'load/multi' - - -class SingleBase: - target: str = 'load/single' - -# vim:sw=4:ts=4:et: +# pylint: disable=unused-import +"""Common module for tests.api.load.""" +from __future__ import annotations + +from ...common import ( # noqa: F401 + get_test_ids, load_data_for_testfile +) +from ..single_load.constants import LOADER_TYPES # noqa: F401 diff --git a/tests/res/dicts/get/30/s/10.txt b/tests/api/load/multi_load/__init__.py similarity index 100% rename from tests/res/dicts/get/30/s/10.txt rename to tests/api/load/multi_load/__init__.py diff --git a/tests/api/load/multi_load/common.py b/tests/api/load/multi_load/common.py new file mode 100644 index 00000000..ca1bde07 --- /dev/null +++ b/tests/api/load/multi_load/common.py @@ -0,0 +1,13 @@ +# +# Copyright (C) 2021 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +# pylint: disable=unused-import +"""Common module for tests.api.load.""" +from __future__ import annotations + +from ...multi_load.common import ( # noqa: F401 + NAMES, GLOB_PATTERN, + load_data_for_testfile, get_test_ids +) diff --git a/tests/api/load/multi_load/test_basics.py b/tests/api/load/multi_load/test_basics.py new file mode 100644 index 00000000..33996a1f --- /dev/null +++ b/tests/api/load/multi_load/test_basics.py @@ -0,0 +1,105 @@ +# +# Copyright (C) 2021 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Test cases for anyconfig.api.load (multi_load).""" +from __future__ import annotations + +import collections +import typing + +import pytest + +import anyconfig.api._load as TT + +from .common import ( + NAMES, GLOB_PATTERN, load_data_for_testfile, get_test_ids +) + +if typing.TYPE_CHECKING: + import pathlib + + +DATA = load_data_for_testfile(__file__) +DATA_IDS: list[str] = get_test_ids(DATA) + +DATA_W_GLOB = [ + (inputs[0].parent / GLOB_PATTERN, opts, exp) + for inputs, opts, exp in DATA +] + + +def test_data() -> None: + assert DATA + + +def test_load_with_empty_list() -> None: + with pytest.raises(ValueError): + TT.load([]) + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load_for_a_list_of_path_objects( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + assert TT.load(inputs, **opts) == exp + assert TT.load((i for i in inputs), **opts) == exp + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load_for_a_list_of_path_strings( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + assert TT.load([str(i) for i in inputs], **opts) == exp + assert TT.load((str(i) for i in inputs), **opts) == exp + + +@pytest.mark.parametrize( + NAMES, DATA_W_GLOB, ids=get_test_ids(DATA_W_GLOB) +) +def test_load_for_glob_patterns( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + assert TT.load(inputs, **opts) == exp + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load_for_a_list_of_streams( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + assert TT.load([i.open() for i in inputs], **opts) == exp + + +class MyDict(collections.OrderedDict): + pass + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load_with_ac_dict_option( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + res = TT.load(inputs, ac_dict=MyDict, **opts) + assert res == exp + assert isinstance(res, MyDict) + + +@pytest.mark.parametrize(NAMES, DATA[:1], ids=DATA_IDS[:1]) +def test_load_with_wrong_merge_strategy( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + assert exp # dummy to avoid an error of unused argument. + with pytest.raises(ValueError): + TT.load(inputs, ac_merge="wrong_merge_strategy", **opts) + + +def test_load_with_ignore_missing_option(): + paths = [ + "/path/to/file_not_exist_0.json", + "/path/to/file_not_exist_1.json", + "/path/to/file_not_exist_2.json", + ] + with pytest.raises(FileNotFoundError): + TT.load(paths) + + assert TT.load(paths, ac_ignore_missing=True) == {} diff --git a/tests/api/load/multi_load/test_multi_types.py b/tests/api/load/multi_load/test_multi_types.py new file mode 100644 index 00000000..b2851759 --- /dev/null +++ b/tests/api/load/multi_load/test_multi_types.py @@ -0,0 +1,35 @@ +# +# Copyright (C) 2021 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Test cases for anyconfig.api.load with multi type inputs.""" +from __future__ import annotations + +import typing + +import pytest + +import anyconfig.api._load as TT + +from .common import ( + NAMES, load_data_for_testfile, get_test_ids +) + +if typing.TYPE_CHECKING: + import pathlib + + +DATA = load_data_for_testfile(__file__) +DATA_IDS: list[str] = get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + assert TT.load(inputs, **opts) == exp diff --git a/tests/api/load/multi_load/test_query.py b/tests/api/load/multi_load/test_query.py new file mode 100644 index 00000000..8d7ffc3e --- /dev/null +++ b/tests/api/load/multi_load/test_query.py @@ -0,0 +1,53 @@ +# +# Copyright (C) 2021 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Test cases for anyconfig.api.load with query options.""" +from __future__ import annotations + +import typing + +import pytest + +import anyconfig.api._load as TT +import anyconfig.query + +from .common import ( + load_data_for_testfile, get_test_ids +) + +if typing.TYPE_CHECKING: + import pathlib + + +if not anyconfig.query.SUPPORTED: + pytest.skip( + "jmespath lib to neede for query is not available.", + allow_module_level=True + ) + +NAMES: tuple[str, ...] = ("inputs", "query", "exp") +DATA = load_data_for_testfile(__file__, values=(("q", ""), ("e", None))) +DATA_IDS: list[str] = get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load( + inputs: list[pathlib.Path], query: str, exp +) -> None: + assert TT.load(inputs, ac_query=query) == exp + + +@pytest.mark.parametrize(NAMES, DATA[:1], ids=DATA_IDS[:1]) +def test_load_with_invalid_query( + inputs: list[pathlib.Path], query: str, exp +) -> None: + assert query or exp # To avoid an error not using them. + assert TT.load( + inputs, ac_query="" + ) == TT.load(inputs) diff --git a/tests/api/load/multi_load/test_schema.py b/tests/api/load/multi_load/test_schema.py new file mode 100644 index 00000000..8b951a84 --- /dev/null +++ b/tests/api/load/multi_load/test_schema.py @@ -0,0 +1,72 @@ +# +# Copyright (C) 2021 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Test cases for anyconfig.api.load with schema validation.""" +from __future__ import annotations + +import typing + +import pytest + +import anyconfig.api._load as TT +import anyconfig.schema + +from anyconfig.api import ValidationError + +from . import common + +if typing.TYPE_CHECKING: + import pathlib + + +if "jsonschema" not in anyconfig.schema.VALIDATORS: + pytest.skip( + "jsonschema lib is not available.", + allow_module_level=True + ) + + +def scm_path_from_inputs(inputs: list[pathlib.Path]) -> pathlib.Path: + path = inputs[0] + name = path.name[:-len(path.suffix)] + return list((path.parent / "s").glob(f"{name}.*"))[0] + + +NAMES: tuple[str, ...] = (*common.NAMES, "scm") +DATA = [ + (inputs, *rest, scm_path_from_inputs(inputs)) + for inputs, *rest in common.load_data_for_testfile(__file__) +] +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load( + inputs: list[pathlib.Path], opts: dict, exp, scm: pathlib.Path +) -> None: + assert TT.load(inputs, ac_schema=scm, **opts) == exp + + +SCM_NG_0 = '{"type": "object", "properties": {"a": {"type": "string"}}}' + + +@pytest.mark.parametrize(NAMES, DATA[:1], ids=DATA_IDS[:1]) +def test_load_with_validation_failure( + inputs: list[pathlib.Path], opts: dict, exp, scm: pathlib.Path, + tmp_path: pathlib.Path +) -> None: + assert exp or scm # dummy + + scm = tmp_path / "scm.json" + scm.write_text(SCM_NG_0) + + with pytest.raises(ValidationError): + TT.load( + inputs, ac_schema=scm, ac_schema_safe=False, **opts + ) diff --git a/tests/api/load/multi_load/test_template.py b/tests/api/load/multi_load/test_template.py new file mode 100644 index 00000000..9aa566ff --- /dev/null +++ b/tests/api/load/multi_load/test_template.py @@ -0,0 +1,43 @@ +# +# Copyright (C) 2021 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Test cases for anyconfig.api.load with template options.""" +from __future__ import annotations + +import typing + +import pytest + +import anyconfig.api._load as TT +import anyconfig.template + +from . import common + +if typing.TYPE_CHECKING: + import pathlib + +if not anyconfig.template.SUPPORTED: + pytest.skip( + "jinja2 lib neede for template option is not available", + allow_module_level=True + ) + + +NAMES: tuple[str, ...] = (*common.NAMES, "ctx") +DATA: list = common.load_data_for_testfile( + __file__, values=(("o", {}), ("e", None), ("c", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load( + inputs: list[pathlib.Path], opts: dict, exp, ctx: dict +) -> None: + assert TT.load(inputs, ac_context=ctx, **opts) == exp diff --git a/tests/res/parser/attrlist/10/00.txt b/tests/api/load/single_load/__init__.py similarity index 100% rename from tests/res/parser/attrlist/10/00.txt rename to tests/api/load/single_load/__init__.py diff --git a/tests/api/load/single_load/test_ac_parser.py b/tests/api/load/single_load/test_ac_parser.py new file mode 100644 index 00000000..d88b63f1 --- /dev/null +++ b/tests/api/load/single_load/test_ac_parser.py @@ -0,0 +1,32 @@ +# +# Copyright (C) 2012 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Test cases for anyconfig.api.load with ac_parser argument.""" +from __future__ import annotations + +import typing + +import pytest + +import anyconfig.api._load as TT + +from .. import common + +if typing.TYPE_CHECKING: + import pathlib + + +NAMES: tuple[str, ...] = ("ipath", "opts", "exp") +DATA: list = common.load_data_for_testfile(__file__) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load(ipath: pathlib.Path, opts: dict, exp) -> None: + assert TT.load(ipath, **opts) == exp diff --git a/tests/api/load/single_load/test_basics.py b/tests/api/load/single_load/test_basics.py new file mode 100644 index 00000000..cfd4eba0 --- /dev/null +++ b/tests/api/load/single_load/test_basics.py @@ -0,0 +1,104 @@ +# +# Copyright (C) 2012 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Test cases for anyconfig.api.load with basic test data.""" +from __future__ import annotations + +import collections +import pathlib + +import pytest + +import anyconfig.api._load as TT +import anyconfig.parsers + +from anyconfig.api import ( + UnknownFileTypeError, UnknownProcessorTypeError +) +from .. import common + + +JSON_PARSER = anyconfig.parsers.find(None, 'json') + +NAMES: tuple[str, ...] = ("ipath", "opts", "exp") +DATA: list = common.load_data_for_testfile(__file__) +DATA_IDS: list[str] = common.get_test_ids(DATA) + +NAMES_2: tuple[str, ...] = ("ipath", "exp") +DATA_2: list = [(ipath, exp) for ipath, _, exp in DATA] + + +def test_data() -> None: + assert DATA + + +class MyDict(collections.OrderedDict): + """My original dict class keep key orders.""" + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load_from_stream(ipath, opts, exp): + assert TT.load(ipath.open(), **opts) == exp + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load_from_path_str(ipath, opts, exp): + assert TT.load(str(ipath), **opts) == exp + + +@pytest.mark.parametrize(NAMES_2, DATA_2, ids=DATA_IDS) +def test_load_with_ac_parser_by_instance(ipath, exp): + assert TT.load(ipath, ac_parser=JSON_PARSER) == exp + + +@pytest.mark.parametrize(NAMES_2, DATA_2, ids=DATA_IDS) +def test_load_with_ac_parser_by_id(ipath, exp): + assert TT.load(ipath, ac_parser=JSON_PARSER.cid()) == exp + + +@pytest.mark.parametrize(NAMES_2, DATA_2, ids=DATA_IDS) +def test_load_with_ac_ordered(ipath, exp): + assert TT.load( + ipath, ac_ordered=True + ) == collections.OrderedDict(exp) + + +@pytest.mark.parametrize(NAMES_2, DATA_2, ids=DATA_IDS) +def test_load_with_ac_dict(ipath, exp): + res = TT.load(ipath, ac_dict=MyDict) + assert isinstance(res, MyDict) + assert res == MyDict(**exp) + + +def test_load_missing_file_failures(): + with pytest.raises(FileNotFoundError): + TT.load("not_exist.json") + + +def test_load_unknown_file_type_failures(): + with pytest.raises(UnknownFileTypeError): + TT.load("dummy.txt") + + +def test_load_invalid_parser_object_failures(): + with pytest.raises(ValueError): + TT.load("dummy.txt", ac_parser=object()) + + +@pytest.mark.parametrize( + ("ipath", ), [(ipath, ) for ipath, _, _ in DATA], ids=DATA_IDS +) +def test_load_unknown_processor_type_failures(ipath): + with pytest.raises(UnknownProcessorTypeError): + TT.load(ipath, ac_parser="proc_does_not_exist") + + +def test_load_ignore_missing(): + ipath = pathlib.Path() / 'conf_file_not_exist.json' + assert not ipath.exists() + + assert TT.load( + ipath, ac_parser='json', ac_ignore_missing=True + ) == {} diff --git a/tests/api/load/single_load/test_multi_types.py b/tests/api/load/single_load/test_multi_types.py new file mode 100644 index 00000000..ed20b9e1 --- /dev/null +++ b/tests/api/load/single_load/test_multi_types.py @@ -0,0 +1,34 @@ +# +# Copyright (C) 2021 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Test cases for anyconfig.api.load with multi-type inputs.""" +from __future__ import annotations + +import typing + +import pytest + +import anyconfig.api._load as TT + +from .. import common + +if typing.TYPE_CHECKING: + import pathlib + + +NAMES: tuple[str, ...] = ("ipath", "opts", "exp") +DATA: list = common.load_data_for_testfile(__file__) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load( + ipath: pathlib.Path, opts: dict, exp +): + assert TT.load(ipath, **opts) == exp diff --git a/tests/api/load/single_load/test_primitives.py b/tests/api/load/single_load/test_primitives.py new file mode 100644 index 00000000..739315d6 --- /dev/null +++ b/tests/api/load/single_load/test_primitives.py @@ -0,0 +1,32 @@ +# +# Copyright (C) 2012 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Test cases for anyconfig.api.load to load primitive types.""" +from __future__ import annotations + +import typing + +import pytest + +import anyconfig.api._load as TT + +from .. import common + +if typing.TYPE_CHECKING: + import pathlib + + +NAMES: tuple[str, ...] = ("ipath", "opts", "exp") +DATA: list = common.load_data_for_testfile(__file__) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load(ipath: pathlib.Path, opts: dict, exp) -> None: + assert TT.load(ipath, **opts) == exp diff --git a/tests/api/load/single_load/test_query.py b/tests/api/load/single_load/test_query.py new file mode 100644 index 00000000..9813a41b --- /dev/null +++ b/tests/api/load/single_load/test_query.py @@ -0,0 +1,53 @@ +# +# Copyright (C) 2021 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring, unused-import +"""Test cases for anyconfig.api.load to load primitive types.""" +from __future__ import annotations + +import typing + +import pytest + +import anyconfig.api._load as TT + +try: + import anyconfig.query.query # noqa: F401 +except ImportError: + pytest.skip( + "Required query module is not available", + allow_module_level=True + ) + +from .. import common + +if typing.TYPE_CHECKING: + import pathlib + + +NAMES: tuple[str, ...] = ("ipath", "exp", "query", "opts") +DATA: list = common.load_data_for_testfile( + __file__, (("e", None), ("q", ""), ("o", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + +DATA_2 = [(i, o) for i, _, _, o in DATA] + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load(ipath: pathlib.Path, exp, query, opts): + assert TT.load(ipath, ac_query=query.strip(), **opts) == exp + + +@pytest.mark.parametrize(("ipath", "opts"), DATA_2, ids=DATA_IDS) +def test_load_with_invalid_query_string( + ipath: pathlib.Path, opts +): + assert TT.load( + ipath, ac_query=None, **opts + ) == TT.load(ipath, **opts) diff --git a/tests/api/load/single_load/test_schema.py b/tests/api/load/single_load/test_schema.py new file mode 100644 index 00000000..57db43ba --- /dev/null +++ b/tests/api/load/single_load/test_schema.py @@ -0,0 +1,85 @@ +# +# Copyright (C) 2012 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring, unused-import +"""Test cases for anyconfig.api.load with schema options.""" +from __future__ import annotations + +import pathlib +import typing +import warnings + +import pytest + +import anyconfig.api._load as TT + +from anyconfig.api import ValidationError + +from .. import common + +try: + import jsonschema # noqa: F401 +except ImportError: + pytest.skip( + "Required jsonschema lib is not available.", + allow_module_level=True + ) + + +SCM_NG_0 = '''{ + "type": "object", + "properties": {"key_never_exist": {"type": "string", "required": true}} +}''' + + +def ipath_to_scm_path(ipath: pathlib.Path) -> typing.Optional[pathlib.Path]: + basename: str = ipath.name.replace(ipath.suffix, "") + candidates = list((ipath.parent / "s").glob(f"{basename}.*")) + if candidates: + return candidates[0] + + return None + + +NAMES: tuple[str, ...] = ("ipath", "exp", "opts", "scm") +DATA: list = [ + (i, e, o, ipath_to_scm_path(i)) for i, o, e + in common.load_data_for_testfile(__file__) +] +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load(ipath, exp, opts, scm): + assert scm, f"Not found: {scm!s} [{ipath!s}" + assert TT.load(ipath, ac_schema=scm, **opts) == exp + + +@pytest.mark.parametrize( + ("ipath", "opts"), + [(ipath, opts) for ipath, _, opts, _ in DATA[:1]], + ids=DATA_IDS[:1] +) +def test_load_failures( + ipath, opts, tmp_path: pathlib.Path +) -> None: + scm = tmp_path / 'scm.json' + scm.write_text(SCM_NG_0) + + with warnings.catch_warnings(record=True) as warns: + warnings.simplefilter('always') + res = TT.load( + ipath, ac_schema=scm, ac_schema_safe=True, **opts + ) + assert res is None + assert len(warns) > 0 + assert issubclass(warns[-1].category, UserWarning) + assert 'scm=' in str(warns[-1].message) + + with pytest.raises(ValidationError): + TT.load(ipath, ac_schema=scm, ac_schema_safe=False) diff --git a/tests/api/load/single_load/test_template.py b/tests/api/load/single_load/test_template.py new file mode 100644 index 00000000..1f8265c5 --- /dev/null +++ b/tests/api/load/single_load/test_template.py @@ -0,0 +1,52 @@ +# +# Copyright (C) 2012 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring, unused-import +"""Test cases for anyconfig.api.load with template args.""" +from __future__ import annotations + +import warnings + +import pytest + +import anyconfig.api._load as TT +try: + import anyconfig.template.jinja2 # noqa: F401 +except ImportError: + pytest.skip( + "Requried jinja2 lib is not available.", + allow_module_level=True + ) + +from .. import common + + +NAMES: tuple[str, ...] = ("ipath", "ctx", "exp", "opts") +DATA: list = common.load_data_for_testfile( + __file__, (("c", {}), ("e", None), ("o", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load(ipath, ctx, exp, opts): + assert TT.load(ipath, ac_context=ctx, **opts) == exp + + +def test_load_from_invalid_template(tmp_path): + ipath = tmp_path / "test.json" + ipath.write_text('{"a": "{{ a"}') # broken template string. + + with warnings.catch_warnings(record=True) as warns: + warnings.simplefilter('always') + res = TT.load(ipath, ac_template=True, ac_context={"a": 1}) + + assert res == {"a": '{{ a'} + assert len(warns) > 0 + assert issubclass(warns[-1].category, UserWarning) + assert 'ailed to compile ' in str(warns[-1].message) diff --git a/tests/api/load/single_load/test_toml.py b/tests/api/load/single_load/test_toml.py new file mode 100644 index 00000000..e8339e22 --- /dev/null +++ b/tests/api/load/single_load/test_toml.py @@ -0,0 +1,31 @@ +# +# Copyright (C) 2021 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Test cases for anyconfig.load with input of other file types.""" +from __future__ import annotations + +import pytest + +import anyconfig.api._load as TT + +from .. import common + + +NAMES: tuple[str, ...] = ("ipath", "exp") +DATA: list = common.load_data_for_testfile(__file__, (("e", None), )) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.skipif( + "toml" not in common.LOADER_TYPES, + reason="toml lib is not availabla." +) +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load_for_toml_files(ipath, exp): + assert TT.load(ipath) == exp diff --git a/tests/api/load/single_load/test_yaml.py b/tests/api/load/single_load/test_yaml.py new file mode 100644 index 00000000..973fcd2b --- /dev/null +++ b/tests/api/load/single_load/test_yaml.py @@ -0,0 +1,31 @@ +# +# Copyright (C) 2021 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Test cases for anyconfig.load with input of other file types.""" +from __future__ import annotations + +import pytest + +import anyconfig.api._load as TT + +from .. import common + + +NAMES: tuple[str, ...] = ("ipath", "exp") +DATA: list = common.load_data_for_testfile(__file__, (("e", None), )) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.skipif( + "yaml" not in common.LOADER_TYPES, + reason="yaml loader is not availabla." +) +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_load_for_yaml_files(ipath, exp): + assert TT.load(ipath) == exp diff --git a/tests/api/load/test_basics.py b/tests/api/load/test_basics.py deleted file mode 100644 index d4f37957..00000000 --- a/tests/api/load/test_basics.py +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring, relative-beyond-top-level -from ..multi_load import test_basics as multi -from ..single_load import test_basics as single - -from . import common - - -class SingleTestCase(common.SingleBase, single.TestCase): - pass - - -class MultiTestCase(common.MultiBase, multi.TestCase): - pass - -# vim:sw=4:ts=4:et: diff --git a/tests/api/load/test_multi_types.py b/tests/api/load/test_multi_types.py deleted file mode 100644 index 0d29b8a4..00000000 --- a/tests/api/load/test_multi_types.py +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring, relative-beyond-top-level -from ..multi_load import test_multi_types as multi -from ..single_load import test_multi_types as single -from . import common - - -class SingleTestCase(common.SingleBase, single.TestCase): - pass - - -class MultiTestCase(common.MultiBase, multi.TestCase): - pass - - -# vim:sw=4:ts=4:et: diff --git a/tests/api/load/test_query.py b/tests/api/load/test_query.py deleted file mode 100644 index 4c85119b..00000000 --- a/tests/api/load/test_query.py +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring, relative-beyond-top-level -from ..multi_load import test_query as multi -from ..single_load import test_query as single -from . import common - - -class SingleTestCase(common.SingleBase, single.TestCase): - pass - - -class MultiTestCase(common.MultiBase, multi.TestCase): - pass - - -# vim:sw=4:ts=4:et: diff --git a/tests/api/load/test_schema.py b/tests/api/load/test_schema.py deleted file mode 100644 index b94352a0..00000000 --- a/tests/api/load/test_schema.py +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring, relative-beyond-top-level -from ..multi_load import test_schema as multi -from ..single_load import test_schema as single -from . import common - - -class SingleTestCase(common.SingleBase, single.TestCase): - pass - - -class MultiTestCase(common.MultiBase, multi.TestCase): - pass - - -# vim:sw=4:ts=4:et: diff --git a/tests/api/load/test_templates.py b/tests/api/load/test_templates.py deleted file mode 100644 index 91740a38..00000000 --- a/tests/api/load/test_templates.py +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring, relative-beyond-top-level -from ..multi_load import test_template as multi -from ..single_load import test_template as single -from . import common - - -class SingleTestCase(common.SingleBase, single.TestCase): - pass - - -class MultiTestCase(common.MultiBase, multi.TestCase): - pass - - -# vim:sw=4:ts=4:et: diff --git a/tests/api/loads/common.py b/tests/api/loads/common.py deleted file mode 100644 index 597820ee..00000000 --- a/tests/api/loads/common.py +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring -import unittest - -from ... import base - - -class TestCase(unittest.TestCase, base.TDataCollector): - pattern = '*.txt' - - def setUp(self): - self.init() - -# vim:sw=4:ts=4:et: diff --git a/tests/api/loads/test_basics.py b/tests/api/loads/test_basics.py index b8619b9a..bbc82cb1 100644 --- a/tests/api/loads/test_basics.py +++ b/tests/api/loads/test_basics.py @@ -1,49 +1,61 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring +"""Basic test cases for anyconfig.api.loads.""" +from __future__ import annotations + +import typing import warnings +import pytest + import anyconfig.api._load as TT from anyconfig.api import UnknownProcessorTypeError -from . import common - - -class TestCase(common.TestCase): - - def test_loads(self): - for data in self.each_data(): - self.assertEqual( - TT.loads(data.inp, **data.opts), - data.exp, - f'{data.datadir!s}, {data.inp_path!s}' - ) - - def test_loads_intentional_failures(self): - for data in self.each_data(): - with self.assertRaises(AssertionError): - self.assertEqual(TT.loads(data.inp, **data.opts), {}) - - def test_loads_failure_ac_parser_was_not_given(self): - for data in self.each_data(): - with warnings.catch_warnings(record=True) as warns: - warnings.simplefilter('always') - self.assertEqual(TT.loads(data.inp), None) - self.assertEqual(len(warns), 1) - self.assertTrue(issubclass(warns[-1].category, UserWarning)) - self.assertTrue( - 'ac_parser was not given but' in str(warns[-1].message) - ) - - def test_loads_failure_invalid_ac_parser_was_given(self): - for data in self.each_data(): - with self.assertRaises(UnknownProcessorTypeError): - self.assertEqual( - TT.loads(data.inp, ac_parser='invalid_id'), - None - ) - -# vim:sw=4:ts=4:et: +from ... import common + +if typing.TYPE_CHECKING: + import pathlib + + +NAMES: tuple[str, ...] = ("content", "opts", "exp") + +# .. seealso:: tests.common.tdc +DATA_0: list[ + tuple[pathlib.Path, dict, typing.Any] +] = common.load_data_for_testfile(__file__) + +DATA: list[tuple[str, dict, typing.Any]] = [ + (i.read_text(), o, e) for i, o, e in DATA_0 +] +DATA_IDS: list[str] = common.get_test_ids(DATA_0) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_loads(content: str, opts: dict, exp) -> None: + assert TT.loads(content, **opts) == exp + + +@pytest.mark.parametrize(NAMES, DATA[:1], ids=DATA_IDS[:1]) +def test_loads_withou_ac_parser_option(content: str, opts: dict, exp): + assert opts or exp + with warnings.catch_warnings(record=True) as warns: + warnings.simplefilter('always') + assert TT.loads(content) is None + assert len(warns) == 1 + assert issubclass(warns[-1].category, UserWarning) + assert "ac_parser was not given but" in str(warns[-1].message) + + +@pytest.mark.parametrize(NAMES, DATA[:1], ids=DATA_IDS[:1]) +def test_loads_with_invalid_ac_parser_option(content: str, opts: dict, exp): + assert opts or exp + with pytest.raises(UnknownProcessorTypeError): + assert TT.loads(content, ac_parser="invalid_parser") is None diff --git a/tests/api/loads/test_query.py b/tests/api/loads/test_query.py index 90718735..eed6ff89 100644 --- a/tests/api/loads/test_query.py +++ b/tests/api/loads/test_query.py @@ -3,34 +3,52 @@ # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -import unittest +"""Basic test cases for anyconfig.api.loads.""" +from __future__ import annotations + +import typing + +import pytest import anyconfig.api._load as TT import anyconfig.query -from . import common +from ... import common + + +if not anyconfig.query.SUPPORTED: + pytest.skip( + "Required query module is not available", + allow_module_level=True + ) + + +NAMES: tuple[str, ...] = ("content", "exp", "query", "opts") + +# .. seealso:: tests.common.tdc +DATA_0: list = common.load_data_for_testfile( + __file__, (("e", None), ("q", ""), ("o", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA_0) +DATA: list[tuple[str, dict, typing.Any]] = [ + (i.read_text(), e, q.strip(), o) for i, e, q, o in DATA_0 +] + +def test_data() -> None: + assert DATA -@unittest.skipIf(not anyconfig.query.SUPPORTED, - 'jmespath lib is not available') -class TestCase(common.TestCase): - kind = 'query' - def test_loads_with_query(self): - for data in self.each_data(): - self.assertEqual( - TT.loads(data.inp, ac_query=data.query, **data.opts), - data.exp, - f'{data.datadir!s}, {data.inp_path!s}' - ) +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_loads(content: str, exp, query: str, opts: dict): + assert TT.loads(content, ac_query=query, **opts) == exp - def test_loads_with_invalid_query(self): - opts = dict(ac_parser='json') - for data in self.each_data(): - self.assertEqual( - TT.loads(data.inp, ac_query=None, **opts), - TT.single_load(data.inp_path, **opts), - f'{data.datadir!s}, {data.inp_path!s}' - ) -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_loads_with_invalid_query_option( + content: str, exp, query: str, opts: dict +): + assert exp or query + assert TT.loads( + content, ac_query=None, **opts + ) == TT.loads(content, **opts) diff --git a/tests/api/loads/test_schema.py b/tests/api/loads/test_schema.py index fa0340ff..c2deee0a 100644 --- a/tests/api/loads/test_schema.py +++ b/tests/api/loads/test_schema.py @@ -3,46 +3,62 @@ # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -import unittest +"""Test cases for anyconfig.api.loads with schema validation option.""" +from __future__ import annotations + +import typing import warnings +import pytest + import anyconfig.api._load as TT import anyconfig.schema from anyconfig.api import ValidationError -from . import common +from ... import common + + +if "jsonschema" not in anyconfig.schema.VALIDATORS: + pytest.skip( + "Required schema module 'jsonschema' is not available", + allow_module_level=True + ) + + +NAMES: tuple[str, ...] = ("content", "exp", "scm", "opts") + +# .. seealso:: tests.common.tdc +DATA_0: list = common.load_data_for_testfile( + __file__, (("e", None), ("s", ""), ("o", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA_0) +DATA: list[tuple[str, dict, typing.Any]] = [ + (i.read_text(), e, s.strip(), o) for i, e, s, o in DATA_0 +] + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_loads(content: str, exp, scm: str, opts: dict): + assert TT.loads(content, ac_schema=scm, **opts) == exp SCM_NG_0 = '{"type": "object", "properties": {"a": {"type": "string"}}}' -@unittest.skipIf("jsonschema" not in anyconfig.schema.VALIDATORS, - 'jsonschema lib is not available') -class TestCase(common.TestCase): - kind = 'schema' - - def test_loads_with_schema_validation(self): - for data in self.each_data(): - scm = data.scm.read_text().strip() - self.assertEqual( - TT.loads(data.inp, ac_schema=scm, **data.opts), - data.exp, - f'{data.datadir!s}, {data.inp_path!s}' - ) - - def test_loads_with_schema_validation_failures(self): - opts = dict(ac_parser='json', ac_schema=SCM_NG_0) - - for data in self.each_data(): - with warnings.catch_warnings(record=True) as warns: - warnings.simplefilter('always') - self.assertTrue( - TT.loads(data.inp, **opts) is None, - f'{data.datadir!s}, {data.inp_path!s}' - ) - self.assertTrue(len(warns) > 0) - self.assertTrue(issubclass(warns[-1].category, UserWarning)) - - with self.assertRaises(ValidationError): - TT.loads(data.inp, ac_schema_safe=False, **opts) +@pytest.mark.parametrize(NAMES, DATA[:1], ids=DATA_IDS[:1]) +def test_loads_without_schema(content: str, exp, scm: str, opts: dict): + assert scm or exp + + with pytest.raises(ValidationError): + TT.loads(content, ac_schema=SCM_NG_0, ac_schema_safe=False, **opts) + + with warnings.catch_warnings(record=True) as warns: + warnings.simplefilter("always") + assert TT.loads(content, ac_schema=SCM_NG_0, **opts) is None + assert len(warns) > 0 + assert issubclass(warns[-1].category, UserWarning) diff --git a/tests/api/loads/test_template.py b/tests/api/loads/test_template.py index e8b4f5b0..e3551bc9 100644 --- a/tests/api/loads/test_template.py +++ b/tests/api/loads/test_template.py @@ -1,37 +1,55 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -import unittest +"""Test cases for anyconfig.api.single_load with schema options.""" +from __future__ import annotations + +import typing import warnings +import pytest + import anyconfig.api._load as TT import anyconfig.template -from . import common +from ... import common + + +if not anyconfig.template.SUPPORTED: + pytest.skip( + "jinja2 template lib is not available", + allow_module_level=True + ) + + +NAMES: tuple[str, ...] = ("content", "exp", "ctx", "opts") + +# .. seealso:: tests.common.tdc +DATA_0: list = common.load_data_for_testfile( + __file__, (("e", None), ("c", {}), ("o", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA_0) +DATA: list[tuple[str, dict, typing.Any]] = [ + (i.read_text(), *eco) for i, *eco in DATA_0 +] + +def test_data() -> None: + assert DATA -@unittest.skipIf(not anyconfig.template.SUPPORTED, - 'jinja2 template lib is not available') -class TestCase(common.TestCase): - kind = 'template' - def test_loads_template(self): - for data in self.each_data(): - self.assertEqual( - TT.loads(data.inp, ac_context=data.ctx, **data.opts), - data.exp, - f'{data.datadir!s}, {data.inp_path!s}' - ) +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_loads(content: str, exp, ctx: dict, opts: dict): + assert TT.loads(content, ac_context=ctx, **opts) == exp - def test_loads_from_template_failures(self): - inp = '{"a": "{{ a"}' - with warnings.catch_warnings(record=True) as warns: - warnings.simplefilter('always') - res = TT.loads(inp, ac_parser='json', ac_template=True) - self.assertEqual(res, dict(a='{{ a')) - # self.assertEqual(len(warns), 1) # Needs to fix plugins - self.assertTrue(issubclass(warns[-1].category, UserWarning)) -# vim:sw=4:ts=4:et: +def test_loads_failures(): + content = '{"a": "{{ a"}' + with warnings.catch_warnings(record=True) as warns: + warnings.simplefilter("always") + res = TT.loads(content, ac_parser="json", ac_template=True) + assert res == {"a": "{{ a"} + # self.assertEqual(len(warns), 1) # Needs to fix plugins + assert issubclass(warns[-1].category, UserWarning) diff --git a/tests/api/multi_load/collector.py b/tests/api/multi_load/collector.py deleted file mode 100644 index f570cce2..00000000 --- a/tests/api/multi_load/collector.py +++ /dev/null @@ -1,45 +0,0 @@ -# -# Copyright (C) 2021 - 2024 Satoru SATOH -# SPDX-License-Identifier: MIT -# -"""Collector to collect file based test data. -""" -from __future__ import annotations - -import typing - -from ... import base -from . import datatypes, utils - -if typing.TYPE_CHECKING: - import collections.abc - - -class DataCollector(base.TDataCollector): - """Data collector for api.multi_load - """ - def load_datasets(self) -> list[datatypes.TData]: - """Load test data from files. - """ - _datasets = sorted( - utils.each_data_from_dir( - self.root, self.pattern, self.should_exist - ) - ) - if not _datasets: - raise ValueError(f'No data: {self.root!s}') - - for tdata in _datasets: - if not tdata.inputs: - raise ValueError(f'No data in subdir: {tdata.subdir!s}') - - return _datasets - - def each_data(self) -> collections.abc.Iterator[datatypes.TData]: - """Yields test data. - """ - if not self.initialized: - self.init() - - for tdata in self.datasets: - yield tdata diff --git a/tests/api/multi_load/common.py b/tests/api/multi_load/common.py index dd519995..5d58692f 100644 --- a/tests/api/multi_load/common.py +++ b/tests/api/multi_load/common.py @@ -1,41 +1,33 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -r"""Common utility functions. +"""Common constants and utility functions for test cases of +anyconfig.api.multi_load. """ -import unittest +from __future__ import annotations -import anyconfig.api._load as TT +import anyconfig.api.utils -from . import collector +from ... import common -class TestCase(unittest.TestCase, collector.DataCollector): +NAMES: tuple[str, ...] = ("inputs", "opts", "exp") +GLOB_PATTERN: str = "*.*" - @staticmethod - def target_fn(*args, **kwargs): - return TT.multi_load(*args, **kwargs) - def setUp(self): - self.init() +def load_data_for_testfile(testfile: str, **kwargs): + return [ + (sorted(i.parent.glob(GLOB_PATTERN)), opts, exp, *rest) + for i, opts, exp, *rest + in common.load_data_for_testfile(testfile, **kwargs) + if exp is not None + ] - def test_multi_load(self): - for tdata in self.each_data(): - self.assertEqual( - self.target_fn(tdata.inputs, **tdata.opts), - tdata.exp, - tdata - ) - def test_multi_load_failures(self): - for tdata in self.each_data(): - with self.assertRaises(AssertionError): - self.assertEqual( - self.target_fn(tdata.inputs, **tdata.opts), - None, - tdata - ) - -# vim:sw=4:ts=4:et: +def get_test_ids(data: list) -> list[str]: + return common.get_test_ids( + [(mis[0] if anyconfig.utils.is_iterable(mis) else mis, *rest) + for mis, *rest in data] + ) diff --git a/tests/api/multi_load/datatypes.py b/tests/api/multi_load/datatypes.py deleted file mode 100644 index 96b66b5f..00000000 --- a/tests/api/multi_load/datatypes.py +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright (C) 2021 - 2024 Satoru SATOH -# SPDX-License-Identifier: MIT -# -"""Common data types for api.multi_load test cases. -""" -from __future__ import annotations - -import pathlib -import typing - - -DictT = dict[str, typing.Any] - - -class TData(typing.NamedTuple): - """A namedtuple object keeps test data. - """ - datadir: pathlib.Path - inputs: list[pathlib.Path] # Same as the above. - exp: DictT - opts: DictT - scm: pathlib.Path - query: str - ctx: DictT diff --git a/tests/api/multi_load/test_basics.py b/tests/api/multi_load/test_basics.py index 932be1ce..aa218e8b 100644 --- a/tests/api/multi_load/test_basics.py +++ b/tests/api/multi_load/test_basics.py @@ -1,60 +1,104 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring +"""Test cases for anyconfig.api.multi_load.""" +from __future__ import annotations + import collections +import typing + +import pytest + +import anyconfig.api._load as TT + +from .common import ( + NAMES, GLOB_PATTERN, load_data_for_testfile, get_test_ids +) + +if typing.TYPE_CHECKING: + import pathlib + + +DATA = load_data_for_testfile(__file__) +DATA_IDS: list[str] = get_test_ids(DATA) + +DATA_W_GLOB = [ + (inputs[0].parent / GLOB_PATTERN, opts, exp) + for inputs, opts, exp in DATA +] + + +def test_data() -> None: + assert DATA + + +def test_multi_load_with_empty_list() -> None: + assert TT.multi_load([]) == {} -from ... import base -from . import common + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_multi_load_for_a_list_of_path_objects( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + assert TT.multi_load(inputs, **opts) == exp + assert TT.multi_load((i for i in inputs), **opts) == exp + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_multi_load_for_a_list_of_path_strings( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + assert TT.multi_load([str(i) for i in inputs], **opts) == exp + assert TT.multi_load((str(i) for i in inputs), **opts) == exp + + +@pytest.mark.parametrize( + NAMES, DATA_W_GLOB, ids=get_test_ids(DATA_W_GLOB) +) +def test_multi_load_for_glob_patterns( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + assert TT.multi_load(inputs, **opts) == exp + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_multi_load_for_a_list_of_streams( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + assert TT.multi_load([i.open() for i in inputs], **opts) == exp class MyDict(collections.OrderedDict): pass -class TestCase(common.TestCase): - - def test_multi_load_from_empty_path_list(self): - self.assertEqual(self.target_fn([]), base.NULL_CNTNR) - - def test_multi_load_from_glob_path_str(self): - for tdata in self.each_data(): - self.assertEqual( - self.target_fn((str(i) for i in tdata.inputs), **tdata.opts), - tdata.exp - ) - - def test_multi_load_from_streams(self): - for tdata in self.each_data(): - self.assertEqual( - self.target_fn((i.open() for i in tdata.inputs), **tdata.opts), - tdata.exp - ) - - def test_multi_load_to_ac_dict(self): - for tdata in self.each_data(): - res = self.target_fn(tdata.inputs, ac_dict=MyDict, **tdata.opts) - self.assertEqual(res, tdata.exp, tdata) - self.assertTrue(isinstance(res, MyDict)) - - def test_multi_load_with_wrong_merge_strategy(self): - for tdata in self.each_data(): - with self.assertRaises(ValueError): - self.target_fn(tdata.inputs, ac_merge='wrong_merge_strategy') - - def test_multi_load_with_ignore_missing_option(self): - paths = [ - 'file_not_exist_0.json', - 'file_not_exist_1.json', - 'file_not_exist_2.json', - ] - with self.assertRaises(FileNotFoundError): - self.target_fn(paths) - - self.assertEqual( - self.target_fn(paths, ac_ignore_missing=True), - base.NULL_CNTNR - ) - -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_multi_load_with_ac_dict_option( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + res = TT.multi_load(inputs, ac_dict=MyDict, **opts) + assert res == exp + assert isinstance(res, MyDict) + + +@pytest.mark.parametrize(NAMES, DATA[:1], ids=DATA_IDS[:1]) +def test_multi_load_with_wrong_merge_strategy( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + assert exp # dummy to avoid an error of unused argument. + with pytest.raises(ValueError): + TT.multi_load(inputs, ac_merge="wrong_merge_strategy", **opts) + + +def test_multi_load_with_ignore_missing_option(): + paths = [ + "/path/to/file_not_exist_0.json", + "/path/to/file_not_exist_1.json", + "/path/to/file_not_exist_2.json", + ] + with pytest.raises(FileNotFoundError): + TT.multi_load(paths) + + assert TT.multi_load(paths, ac_ignore_missing=True) == {} diff --git a/tests/api/multi_load/test_collector.py b/tests/api/multi_load/test_collector.py deleted file mode 100644 index f8fb574c..00000000 --- a/tests/api/multi_load/test_collector.py +++ /dev/null @@ -1,54 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring -import json -import unittest - -from . import collector as TT - - -class NoDataCollector(TT.DataCollector): - kind = 'not_exist' - - -class TestCase(unittest.TestCase): - - def test_load_datasets_failures(self): - collector = NoDataCollector() - with self.assertRaises(ValueError): - collector.init() - - def test_load_datasets(self): - collector = TT.DataCollector() - collector.init() - res = collector.datasets - - inp_refs = list(collector.root.glob(f'*/{collector.pattern}')) - assert bool(inp_refs) - - e_refs = list(collector.root.glob('*/e/*.json')) - assert bool(e_refs) - - o_refs = list(collector.root.glob('*/o/*.json')) - assert bool(o_refs) - - s_refs = list(collector.root.glob('*/s/*.json')) - assert bool(s_refs) - - for inp in inp_refs: - self.assertTrue(any(inp in td.inputs for td in res)) - - for e_file in e_refs: - e_ref = json.load(e_file.open()) - self.assertTrue(any(e_ref == td.exp for td in res)) - - for o_file in o_refs: - o_ref = json.load(o_file.open()) - self.assertTrue(any(o_ref == td.opts for td in res)) - - for s_file in s_refs: - self.assertTrue(any(s_file == td.scm for td in res)) - -# vim:sw=4:ts=4:et: diff --git a/tests/api/multi_load/test_common.py b/tests/api/multi_load/test_common.py deleted file mode 100644 index 764576f8..00000000 --- a/tests/api/multi_load/test_common.py +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=invalid-name,missing-docstring -import pathlib - -from . import common -from ... import base - - -CUR_DIR = pathlib.Path(__file__).parent - - -class TestCase(common.TestCase): - - def test_members(self): - self.assertNotEqual(self.target, base.TDataCollector.target) - self.assertEqual(self.target, CUR_DIR.name) - self.assertEqual( - self.root, - CUR_DIR.parent.parent / 'res' / self.target / self.kind - ) - self.assertTrue(self.datasets) - -# vim:sw=4:ts=4:et: diff --git a/tests/api/multi_load/test_multi_types.py b/tests/api/multi_load/test_multi_types.py index aad2060b..a1bc525b 100644 --- a/tests/api/multi_load/test_multi_types.py +++ b/tests/api/multi_load/test_multi_types.py @@ -1,13 +1,35 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -from . import common +"""Test cases for anyconfig.api.multi_load with multi type inputs.""" +from __future__ import annotations +import typing -class TestCase(common.TestCase): - kind = 'multi_types' - pattern = '*.*' +import pytest -# vim:sw=4:ts=4:et: +import anyconfig.api._load as TT + +from .common import ( + NAMES, load_data_for_testfile, get_test_ids +) + +if typing.TYPE_CHECKING: + import pathlib + + +DATA = load_data_for_testfile(__file__) +DATA_IDS: list[str] = get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_multi_load( + inputs: list[pathlib.Path], opts: dict, exp +) -> None: + assert TT.multi_load(inputs, **opts) == exp diff --git a/tests/api/multi_load/test_query.py b/tests/api/multi_load/test_query.py index 9eb8ff96..402cf651 100644 --- a/tests/api/multi_load/test_query.py +++ b/tests/api/multi_load/test_query.py @@ -1,35 +1,53 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -import unittest +"""Test cases for anyconfig.api.multi_load with query options.""" +from __future__ import annotations +import typing + +import pytest + +import anyconfig.api._load as TT import anyconfig.query -from . import common +from .common import ( + load_data_for_testfile, get_test_ids +) + +if typing.TYPE_CHECKING: + import pathlib + + +if not anyconfig.query.SUPPORTED: + pytest.skip( + "jmespath lib to neede for query is not available.", + allow_module_level=True + ) + +NAMES: tuple[str, ...] = ("inputs", "query", "exp") +DATA = load_data_for_testfile(__file__, values=(("q", ""), ("e", None))) +DATA_IDS: list[str] = get_test_ids(DATA) + +def test_data() -> None: + assert DATA -@unittest.skipIf(not anyconfig.query.SUPPORTED, - 'jmespath lib is not available') -class TestCase(common.TestCase): - kind = 'query' - should_exist = ('e', 'q') - def test_multi_load(self): - for tdata in self.each_data(): - self.assertEqual( - self.target_fn( - tdata.inputs, ac_query=tdata.query, **tdata.opts - ), - tdata.exp - ) +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_multi_load( + inputs: list[pathlib.Path], query: str, exp +) -> None: + assert TT.multi_load(inputs, ac_query=query) == exp - def test_multi_load_with_invalid_query(self): - for tdata in self.each_data(): - self.assertEqual( - self.target_fn(tdata.inputs, ac_query='', **tdata.opts), - self.target_fn(tdata.inputs) - ) -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA[:1], ids=DATA_IDS[:1]) +def test_multi_load_with_invalid_query( + inputs: list[pathlib.Path], query: str, exp +) -> None: + assert query or exp # To avoid an error not using them. + assert TT.multi_load( + inputs, ac_query="" + ) == TT.multi_load(inputs) diff --git a/tests/api/multi_load/test_schema.py b/tests/api/multi_load/test_schema.py index 5ef209ba..2a302c3f 100644 --- a/tests/api/multi_load/test_schema.py +++ b/tests/api/multi_load/test_schema.py @@ -3,43 +3,69 @@ # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -import pathlib -import tempfile -import unittest +from __future__ import annotations +import typing + +import pytest + +import anyconfig.api._load as TT import anyconfig.schema from anyconfig.api import ValidationError from . import common +if typing.TYPE_CHECKING: + import pathlib + + +if "jsonschema" not in anyconfig.schema.VALIDATORS: + pytest.skip( + "jsonschema lib is not available.", + allow_module_level=True + ) + + +def scm_path_from_inputs(inputs: list[pathlib.Path]) -> pathlib.Path: + path = inputs[0] + name = path.name[:-len(path.suffix)] + return list((path.parent / "s").glob(f"{name}.*"))[0] + + +NAMES: tuple[str, ...] = (*common.NAMES, "scm") +DATA = [ + (inputs, *rest, scm_path_from_inputs(inputs)) + for inputs, *rest in common.load_data_for_testfile(__file__) +] +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_multi_load( + inputs: list[pathlib.Path], opts: dict, exp, scm: pathlib.Path +) -> None: + assert TT.multi_load(inputs, ac_schema=scm, **opts) == exp + SCM_NG_0 = '{"type": "object", "properties": {"a": {"type": "string"}}}' -@unittest.skipIf("jsonschema" not in anyconfig.schema.VALIDATORS, - 'jsonschema lib is not available') -class TestCase(common.TestCase): - kind = 'schema' - - def test_multi_load(self): - for tdata in self.each_data(): - self.assertEqual( - self.target_fn( - tdata.inputs, ac_schema=tdata.scm, **tdata.opts - ), - tdata.exp, - tdata - ) - - def test_multi_load_with_schema_validation_failure(self): - with tempfile.TemporaryDirectory() as tdir: - wdir = pathlib.Path(tdir) - scm = wdir / 'scm.json' - scm.write_text(SCM_NG_0) - - for tdata in self.each_data(): - with self.assertRaises(ValidationError): - self.target_fn( - tdata.inputs, ac_schema=scm, ac_schema_safe=False - ) +@pytest.mark.parametrize(NAMES, DATA[:1], ids=DATA_IDS[:1]) +def test_multi_load_with_validation_failure( + inputs: list[pathlib.Path], opts: dict, exp, scm: pathlib.Path, + tmp_path: pathlib.Path +) -> None: + assert exp or scm # dummy + + scm = tmp_path / "scm.json" + scm.write_text(SCM_NG_0) + + with pytest.raises(ValidationError): + TT.multi_load( + inputs, ac_schema=scm, ac_schema_safe=False, **opts + ) diff --git a/tests/api/multi_load/test_template.py b/tests/api/multi_load/test_template.py index 65c3d7d8..f8cc596d 100644 --- a/tests/api/multi_load/test_template.py +++ b/tests/api/multi_load/test_template.py @@ -1,39 +1,43 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -import unittest +"""Test cases for anyconfig.api.multi_load with template options.""" +from __future__ import annotations +import typing + +import pytest + +import anyconfig.api._load as TT import anyconfig.template from . import common +if typing.TYPE_CHECKING: + import pathlib + +if not anyconfig.template.SUPPORTED: + pytest.skip( + "jinja2 lib neede for template option is not available", + allow_module_level=True + ) + + +NAMES: tuple[str, ...] = (*common.NAMES, "ctx") +DATA: list = common.load_data_for_testfile( + __file__, values=(("o", {}), ("e", None), ("c", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + -@unittest.skipIf(not anyconfig.template.SUPPORTED, - 'jinja2 template lib is not available') -class TestCase(common.TestCase): - kind = 'template' - - def test_multi_load(self): - for tdata in self.each_data(): - self.assertEqual( - self.target_fn( - tdata.inputs, ac_context=tdata.ctx, **tdata.opts - ), - tdata.exp, - tdata - ) - - def test_multi_load_failures(self): - for tdata in self.each_data(): - with self.assertRaises(AssertionError): - self.assertEqual( - self.target_fn( - tdata.inputs, ac_context=tdata.ctx, **tdata.opts - ), - None, - tdata - ) - -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_multi_load( + inputs: list[pathlib.Path], opts: dict, exp, ctx: dict +) -> None: + assert TT.multi_load(inputs, ac_context=ctx, **opts) == exp diff --git a/tests/api/multi_load/test_utils.py b/tests/api/multi_load/test_utils.py deleted file mode 100644 index 96100033..00000000 --- a/tests/api/multi_load/test_utils.py +++ /dev/null @@ -1,94 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring -import json -import pathlib -import unittest -import tempfile - -from ... import base -from . import utils as TT - - -RES_DIR = base.RES_DIR / 'multi_load' -SELF = pathlib.Path(__file__) - - -class TestCase(unittest.TestCase): - - datadir = RES_DIR / 'basics' - - def test_load_data_or_path_no_data(self): - with tempfile.TemporaryDirectory() as tdir: - tmp_path = pathlib.Path(tdir) - aes = [ - ((tmp_path, ), {}, None), - ((tmp_path, ), dict(default='abc'), 'abc'), - ] - for args, kwargs, exp in aes: - self.assertEqual( - TT.load_data_or_path(*args, **kwargs), - exp - ) - - def test_load_data_or_path(self): - # tests/res/multi_load/basics/00/00.json - ddir = self.datadir / '00' - inp = ddir / '00.json' - aes = [ - # datadir, should_exist, load, default - # .. seealso:: tests/res/multi_load/basics/00/00.json - ((ddir, ), dict(load=False), inp), - ((ddir, ), {}, json.load(inp.open())), - ] - for args, kwargs, exp in aes: - self.assertEqual( - TT.load_data_or_path(*args, **kwargs), - exp - ) - - def test_load_data_or_path_failures(self): - datadir = pathlib.Path().cwd() / 'dir_not_exist' - aes = [ - ((datadir, ), dict(should_exist=(datadir.name, )), OSError), - ] - for args, kwargs, exc in aes: - with self.assertRaises(exc): - TT.load_data_or_path(*args, **kwargs) - - def test_each_data_from_dir(self): - inp_refs = list(self.datadir.glob('*/*.json')) - assert bool(inp_refs) - - e_refs = list(self.datadir.glob('*/e/*.json')) - assert bool(e_refs) - - o_refs = list(self.datadir.glob('*/o/*.json')) - assert bool(o_refs) - - aes = [ - ((self.datadir, ), {}, (1, inp_refs, e_refs, o_refs)) - ] - for args, kwargs, exp in aes: - res = list(TT.each_data_from_dir(*args, **kwargs)) - self.assertTrue(bool(res)) - self.assertTrue(len(res) > exp[0]) - - for inp in exp[1]: - self.assertTrue(any(inp in td.inputs for td in res)) - - for e_file in exp[2]: - e_ref = json.load(e_file.open()) - self.assertTrue(any(e_ref == td.exp for td in res)) - - for o_file in exp[3]: - o_ref = json.load(o_file.open()) - self.assertTrue(any(o_ref == td.opts for td in res)) - - def test_each_data_from_dir_failures(self): - with self.assertRaises(ValueError): - _ = list(TT.each_data_from_dir(SELF)) - -# vim:sw=4:ts=4:et: diff --git a/tests/api/multi_load/utils.py b/tests/api/multi_load/utils.py deleted file mode 100644 index 1718fad3..00000000 --- a/tests/api/multi_load/utils.py +++ /dev/null @@ -1,75 +0,0 @@ -# -# Copyright (C) 2021 - 2024 Satoru SATOH -# SPDX-License-Identifier: MIT -# -"""File based test data collector - utility functions. -""" -from __future__ import annotations - -import pathlib -import typing -import warnings - -from ... import base -# load_data, maybe_data_path, - -from .datatypes import TData - -if typing.TYPE_CHECKING: - import collections.abc - - -# .. seealso:: tests.api.multi_load.datatypes -MaybeDataT = typing.Optional[ - typing.Union[str, pathlib.Path, dict[str, typing.Any]] -] - - -def load_data_or_path( - datadir: pathlib.Path, should_exist: collections.abc.Iterable[str] = (), - load: bool = True, - default: typing.Optional[typing.Any] = None -) -> MaybeDataT: - """ - Load data from a file in the ``datadir`` of which name matches ``pattern``. - """ - maybe_file = base.maybe_data_path(datadir, '*', should_exist=should_exist) - if maybe_file is None: - return default - - if load: - return base.load_data(maybe_file) - - return maybe_file - - -def each_data_from_dir( - datadir: pathlib.Path, pattern: str = '*.json', - should_exist: collections.abc.Iterable[str] = () -) -> collections.abc.Iterator[TData]: - """ - Yield a collection of paths of data files under given dir. - """ - if not datadir.is_dir(): - raise ValueError(f'Not look a data dir: {datadir!s}') - - for subdir in sorted(datadir.glob('*')): - if not subdir.is_dir(): - warnings.warn(f'Not looks a dir: {subdir!s}', stacklevel=2) - continue - - if not bool(list(subdir.glob('*.*'))): - warnings.warn(f'No data in subdir: {subdir!s}', stacklevel=2) - continue - - yield TData( - subdir, - sorted( - inp for inp in subdir.glob(pattern) if inp.is_file() - ), - load_data_or_path(subdir / 'e', should_exist, default={}), - load_data_or_path(subdir / 'o', should_exist, default={}), - load_data_or_path(subdir / 's', should_exist, load=False), - load_data_or_path(subdir / 'q', should_exist, default=''), - load_data_or_path(subdir / 'c', should_exist, default={}), - ) diff --git a/tests/api/open/common.py b/tests/api/open/common.py deleted file mode 100644 index f3da774d..00000000 --- a/tests/api/open/common.py +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring -import unittest - -from ... import base - - -class BaseTestCase(base.TDataCollector, unittest.TestCase): - target = 'open' - -# vim:sw=4:ts=4:et: diff --git a/tests/api/open/test_basics.py b/tests/api/open/test_basics.py index 1925c223..d44d34fe 100644 --- a/tests/api/open/test_basics.py +++ b/tests/api/open/test_basics.py @@ -1,37 +1,49 @@ # -# Copyright (C) 2012 - 2019 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring, invalid-name, no-member -import pathlib +# pylint: disable=missing-docstring, no-member +"""Test cases for api.open.""" +from __future__ import annotations + import pickle -import tempfile +import typing + +import pytest import anyconfig.api._open as TT import anyconfig.api._load as LD -from . import common +from ... import common + +if typing.TYPE_CHECKING: + import pathlib + + +NAMES: tuple[str, ...] = ("ipath", "exp", "opts") +DATA: list[ + tuple[pathlib.Path, typing.Optional[dict], dict] +] = common.load_data_for_testfile(__file__, values=(("e", None), ("o", {}))) + +DATA_IDS: list[str] = common.get_test_ids(DATA) + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_open_text_io(ipath, exp, opts): + with TT.open(ipath, **opts) as inp: + assert LD.load(inp, **opts) == exp -class TestCase(common.BaseTestCase): - def test_open_text_io(self): - for data in self.each_data(): - with TT.open(data.inp_path, **data.opts) as inp: - self.assertEqual(LD.loads(inp.read(), **data.opts), data.inp) +def test_open_byte_io(tmp_path): + cnf = {"a": 1, "b": "b"} - def test_open_byte_io(self): - cnf = dict(a=1, b='b') + path = tmp_path / "test.pickle" + pickle.dump(cnf, path.open(mode="wb")) - with tempfile.TemporaryDirectory() as workdir: - path = pathlib.Path(workdir) / 'test.pkl' - pickle.dump(cnf, path.open(mode='wb')) + opts = {"ac_parser": "pickle"} - with TT.open(path) as fio: - self.assertEqual(fio.mode, 'rb') - self.assertEqual( - LD.loads(fio.read(), ac_parser='pickle'), - LD.load(path) - ) + with TT.open(path, **opts) as fio: + assert fio.mode == "rb" + data: bytes = fio.read() -# vim:sw=4:ts=4:et: + assert LD.loads(data, **opts) == cnf diff --git a/tests/api/single_load/common.py b/tests/api/single_load/common.py deleted file mode 100644 index 11ea78e0..00000000 --- a/tests/api/single_load/common.py +++ /dev/null @@ -1,41 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring -import unittest - -import anyconfig.api._load as TT - -from ... import base - - -class Collector(base.TDataCollector): - - @staticmethod - def target_fn(*args, **kwargs): - return TT.single_load(*args, **kwargs) - - -class TestCase(unittest.TestCase, Collector): - - def setUp(self): - self.init() - - def test_single_load(self): - for data in self.each_data(): - self.assertEqual( - self.target_fn(data.inp_path, **data.opts), - data.exp, - data - ) - - def test_single_load_intentional_failures(self): - for data in self.each_data(): - with self.assertRaises(AssertionError): - self.assertEqual( - self.target_fn(data.inp_path, **data.opts), - None - ) - -# vim:sw=4:ts=4:et: diff --git a/tests/api/single_load/constants.py b/tests/api/single_load/constants.py new file mode 100644 index 00000000..f9029706 --- /dev/null +++ b/tests/api/single_load/constants.py @@ -0,0 +1,11 @@ +# +# Copyright (C) 2021 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +""""Constants for tests cases of anyconfig.api.single_load.""" +from __future__ import annotations + +import anyconfig.api + + +LOADER_TYPES = frozenset(anyconfig.api.list_types()) diff --git a/tests/api/single_load/test_ac_parser.py b/tests/api/single_load/test_ac_parser.py index 6e0cc1a4..d09e84ea 100644 --- a/tests/api/single_load/test_ac_parser.py +++ b/tests/api/single_load/test_ac_parser.py @@ -1,13 +1,34 @@ # -# Copyright (C) 2012 - 2021 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -from . import common +"""Test cases for anyconfig.api.single_load with ac_parser argument.""" +from __future__ import annotations +import typing -class TestCase(common.TestCase): - kind = 'ac_parser' - pattern = '*.conf' +import pytest -# vim:sw=4:ts=4:et: +import anyconfig.api._load as TT + +from ... import common + +if typing.TYPE_CHECKING: + import pathlib + + +NAMES: tuple[str, ...] = ("ipath", "opts", "exp") +DATA: list = common.load_data_for_testfile( + __file__, (("o", {}), ("e", None)) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_single_load(ipath: pathlib.Path, opts: dict, exp) -> None: + assert TT.single_load(ipath, **opts) == exp diff --git a/tests/api/single_load/test_basics.py b/tests/api/single_load/test_basics.py index 9da04a50..026025e7 100644 --- a/tests/api/single_load/test_basics.py +++ b/tests/api/single_load/test_basics.py @@ -1,95 +1,105 @@ # -# Copyright (C) 2012 - 2021 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring +from __future__ import annotations + import collections import pathlib +import pytest + import anyconfig.api._load as TT import anyconfig.parsers from anyconfig.api import ( UnknownFileTypeError, UnknownProcessorTypeError ) -from ... import base -from . import common +from ... import common JSON_PARSER = anyconfig.parsers.find(None, 'json') +NAMES: tuple[str, ...] = ("ipath", "opts", "exp") +DATA: list = common.load_data_for_testfile( + __file__, (("o", {}), ("e", None)) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + +NAMES_2: tuple[str, ...] = ("ipath", "exp") +DATA_2: list = [(ipath, exp) for ipath, _, exp in DATA] + + +def test_data() -> None: + assert DATA + class MyDict(collections.OrderedDict): """My original dict class keep key orders.""" -class TestCase(common.TestCase): - - def test_single_load_from_stream(self): - for data in self.each_data(): - self.assertEqual( - TT.single_load(data.inp_path.open(), **data.opts), - data.exp - ) - - def test_single_load_from_path_str(self): - for data in self.each_data(): - self.assertEqual( - TT.single_load(str(data.inp_path), **data.opts), - data.exp - ) - - def test_single_load_with_ac_parser_by_instance(self): - for data in self.each_data(): - self.assertEqual( - TT.single_load(data.inp_path, ac_parser=JSON_PARSER), - data.exp - ) - - def test_single_load_with_ac_parser_by_id(self): - for data in self.each_data(): - self.assertEqual( - TT.single_load(data.inp_path, ac_parser=JSON_PARSER.cid()), - data.exp - ) - - def test_single_load_with_ac_ordered(self): - for data in self.each_data(): - self.assertEqual( - TT.single_load(data.inp_path, ac_ordered=True), - collections.OrderedDict(data.exp) - ) - - def test_single_load_with_ac_dict(self): - for data in self.each_data(): - res = TT.single_load(data.inp_path, ac_dict=MyDict) - self.assertTrue(isinstance(res, MyDict)) - self.assertEqual(res, MyDict(**data.exp)) - - def test_single_load_missing_file_failures(self): - with self.assertRaises(FileNotFoundError): - TT.single_load('not_exist.json') - - def test_single_load_unknown_file_type_failures(self): - with self.assertRaises(UnknownFileTypeError): - TT.single_load('dummy.txt') - - def test_single_load_invalid_parser_object_failures(self): - with self.assertRaises(ValueError): - TT.single_load('dummy.txt', ac_parser=object()) - - def test_single_load_unknown_processor_type_failures(self): - for data in self.each_data(): - with self.assertRaises(UnknownProcessorTypeError): - TT.single_load( - data.inp_path, ac_parser='proc_does_not_exist' - ) - - def test_single_load_ignore_missing(self): - inp = pathlib.Path() / 'conf_file_not_exist.json' - assert not inp.exists() - - res = TT.single_load(inp, ac_parser='json', ac_ignore_missing=True) - self.assertEqual(res, base.NULL_CNTNR) - -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_single_load_from_stream(ipath, opts, exp): + assert TT.single_load(ipath.open(), **opts) == exp + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_single_load_from_path_str(ipath, opts, exp): + assert TT.single_load(str(ipath), **opts) == exp + + +@pytest.mark.parametrize(NAMES_2, DATA_2, ids=DATA_IDS) +def test_single_load_with_ac_parser_by_instance(ipath, exp): + assert TT.single_load(ipath, ac_parser=JSON_PARSER) == exp + + +@pytest.mark.parametrize(NAMES_2, DATA_2, ids=DATA_IDS) +def test_single_load_with_ac_parser_by_id(ipath, exp): + assert TT.single_load(ipath, ac_parser=JSON_PARSER.cid()) == exp + + +@pytest.mark.parametrize(NAMES_2, DATA_2, ids=DATA_IDS) +def test_single_load_with_ac_ordered(ipath, exp): + assert TT.single_load( + ipath, ac_ordered=True + ) == collections.OrderedDict(exp) + + +@pytest.mark.parametrize(NAMES_2, DATA_2, ids=DATA_IDS) +def test_single_load_with_ac_dict(ipath, exp): + res = TT.single_load(ipath, ac_dict=MyDict) + assert isinstance(res, MyDict) + assert res == MyDict(**exp) + + +def test_single_load_missing_file_failures(): + with pytest.raises(FileNotFoundError): + TT.single_load("not_exist.json") + + +def test_single_load_unknown_file_type_failures(): + with pytest.raises(UnknownFileTypeError): + TT.single_load("dummy.txt") + + +def test_single_load_invalid_parser_object_failures(): + with pytest.raises(ValueError): + TT.single_load("dummy.txt", ac_parser=object()) + + +@pytest.mark.parametrize( + ("ipath", ), [(ipath, ) for ipath, _, _ in DATA], ids=DATA_IDS +) +def test_single_load_unknown_processor_type_failures(ipath): + with pytest.raises(UnknownProcessorTypeError): + TT.single_load(ipath, ac_parser="proc_does_not_exist") + + +def test_single_load_ignore_missing(): + ipath = pathlib.Path() / 'conf_file_not_exist.json' + assert not ipath.exists() + + assert TT.single_load( + ipath, ac_parser='json', ac_ignore_missing=True + ) == {} diff --git a/tests/api/single_load/test_common.py b/tests/api/single_load/test_common.py deleted file mode 100644 index 8e8b958b..00000000 --- a/tests/api/single_load/test_common.py +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=invalid-name,missing-docstring -import unittest -import pathlib - -from . import common -from ... import base - - -CUR_DIR = pathlib.Path(__file__).parent - - -class TestCase(common.TestCase): - - def test_members(self): - self.assertNotEqual(self.target, base.TDataCollector.target) - self.assertEqual(self.target, CUR_DIR.name) - self.assertEqual( - self.root, - CUR_DIR.parent.parent / 'res' / self.target / self.kind - ) - self.assertTrue(self.datasets) - - @unittest.skip("I have no idea how to implement this.") - def test_target_fn(self): - self.assertEqual( # This is not satisfied clearly. - self.target_fn, common.TT.single_load - ) - -# vim:sw=4:ts=4:et: diff --git a/tests/api/single_load/test_multi_types.py b/tests/api/single_load/test_multi_types.py index aad2060b..f3c3decc 100644 --- a/tests/api/single_load/test_multi_types.py +++ b/tests/api/single_load/test_multi_types.py @@ -1,13 +1,36 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -from . import common +"""Test cases for anyconfig.api.single_load with multi-type inputs.""" +from __future__ import annotations +import typing -class TestCase(common.TestCase): - kind = 'multi_types' - pattern = '*.*' +import pytest -# vim:sw=4:ts=4:et: +import anyconfig.api._load as TT + +from ... import common + +if typing.TYPE_CHECKING: + import pathlib + + +NAMES: tuple[str, ...] = ("ipath", "opts", "exp") +DATA: list = common.load_data_for_testfile( + __file__, (("o", {}), ("e", None)) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_single_load( + ipath: pathlib.Path, opts: dict, exp +): + assert TT.single_load(ipath, **opts) == exp diff --git a/tests/api/single_load/test_optional_types.py b/tests/api/single_load/test_optional_types.py deleted file mode 100644 index d4b02111..00000000 --- a/tests/api/single_load/test_optional_types.py +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring -import unittest - -import anyconfig.api - -from . import common - - -LOADER_TYPES = frozenset(anyconfig.api.list_types()) - - -@unittest.skipIf('yaml' not in LOADER_TYPES, - 'yaml loader is not available') -class YamlTestCase(common.TestCase): - kind = 'yaml' - pattern = '*.yml' - - -@unittest.skipIf('toml' not in LOADER_TYPES, - 'toml loader is not available') -class TomlTestCase(YamlTestCase): - kind = 'toml' - pattern = '*.toml' - -# vim:sw=4:ts=4:et: diff --git a/tests/api/single_load/test_primitives.py b/tests/api/single_load/test_primitives.py index e2889ce5..1a83acf4 100644 --- a/tests/api/single_load/test_primitives.py +++ b/tests/api/single_load/test_primitives.py @@ -1,12 +1,34 @@ # -# Copyright (C) 2012 - 2021 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -from . import common +"""Test cases for anyconfig.api.single_load to load primitive types.""" +from __future__ import annotations +import typing -class TestCase(common.TestCase): - kind = 'primitives' +import pytest -# vim:sw=4:ts=4:et: +import anyconfig.api._load as TT + +from ... import common + +if typing.TYPE_CHECKING: + import pathlib + + +NAMES: tuple[str, ...] = ("ipath", "opts", "exp") +DATA: list = common.load_data_for_testfile( + __file__, (("o", {}), ("e", None)) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_single_load(ipath: pathlib.Path, opts: dict, exp) -> None: + assert TT.single_load(ipath, **opts) == exp diff --git a/tests/api/single_load/test_query.py b/tests/api/single_load/test_query.py index f5316014..9d2abd85 100644 --- a/tests/api/single_load/test_query.py +++ b/tests/api/single_load/test_query.py @@ -1,49 +1,53 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring -import unittest - -import anyconfig.query - -from . import common - - -@unittest.skipIf(not anyconfig.query.SUPPORTED, - 'jmespath lib is not available') -class TestCase(common.TestCase): - kind = 'query' - - def test_single_load(self): - for data in self.each_data(): - self.assertEqual( - self.target_fn( - data.inp_path, ac_query=data.query.strip(), **data.opts - ), - data.exp, - f'{data.datadir!s}, {data.inp_path!s}' - ) - - def test_single_load_with_invalid_query_string(self): - for data in self.each_data(): - self.assertEqual( - self.target_fn( - data.inp_path, ac_query=None, **data.opts - ), - self.target_fn(data.inp_path, **data.opts), - f'{data.datadir!s}, {data.inp_path!s}' - ) - - def test_single_load_intentional_failures(self): - for data in self.each_data(): - with self.assertRaises(AssertionError): - exp = dict(z=1, zz='zz', zzz=[1, 2, 3], zzzz=dict(z=0)) - self.assertEqual( - self.target_fn( - data.inp_path, ac_query=data.query, **data.opts - ), - exp - ) - -# vim:sw=4:ts=4:et: +# pylint: disable=missing-docstring, unused-import +"""Test cases for anyconfig.api.single_load to load primitive types.""" +from __future__ import annotations + +import typing + +import pytest + +import anyconfig.api._load as TT + +try: + import anyconfig.query.query # noqa: F401 +except ImportError: + pytest.skip( + "Required query module is not available", + allow_module_level=True + ) + +from ... import common + +if typing.TYPE_CHECKING: + import pathlib + + +NAMES: tuple[str, ...] = ("ipath", "exp", "query", "opts") +DATA: list = common.load_data_for_testfile( + __file__, (("e", None), ("q", ""), ("o", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + +DATA_2 = [(i, o) for i, _, _, o in DATA] + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_single_load(ipath: pathlib.Path, exp, query, opts): + assert TT.single_load(ipath, ac_query=query.strip(), **opts) == exp + + +@pytest.mark.parametrize(("ipath", "opts"), DATA_2, ids=DATA_IDS) +def test_single_load_with_invalid_query_string( + ipath: pathlib.Path, opts +): + assert TT.single_load( + ipath, ac_query=None, **opts + ) == TT.single_load(ipath, **opts) diff --git a/tests/api/single_load/test_schema.py b/tests/api/single_load/test_schema.py index 4396473e..62e85889 100644 --- a/tests/api/single_load/test_schema.py +++ b/tests/api/single_load/test_schema.py @@ -2,50 +2,84 @@ # Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring +# pylint: disable=missing-docstring, unused-import +"""Test cases for anyconfig.api.single_load with schema options.""" +from __future__ import annotations + import pathlib -import tempfile -import unittest +import typing import warnings -import anyconfig.schema +import pytest + +import anyconfig.api._load as TT from anyconfig.api import ValidationError -from . import common - - -SCM_NG_0 = '{"type": "object", "properties": {"a": {"type": "string"}}}' - - -@unittest.skipIf("jsonschema" not in anyconfig.schema.VALIDATORS, - 'jsonschema lib is not available') -class TestCase(common.TestCase): - kind = 'schema' - - def test_single_load_with_validateion_failures(self): - with tempfile.TemporaryDirectory() as tdir: - wdir = pathlib.Path(tdir) - scm = wdir / 'scm.json' - scm.write_text(SCM_NG_0) - - for data in self.each_data(): - with warnings.catch_warnings(record=True) as warns: - warnings.simplefilter('always') - self.assertEqual( - self.target_fn( - data.inp_path, ac_schema=scm, ac_schema_safe=True, - **data.opts - ), - None - ) - self.assertTrue(len(warns) > 0) - self.assertTrue( - issubclass(warns[-1].category, UserWarning) - ) - self.assertTrue('scm=' in str(warns[-1].message)) - - with self.assertRaises(ValidationError): - self.target_fn( - data.inp_path, ac_schema=scm, ac_schema_safe=False - ) +from ... import common + +try: + import jsonschema # noqa: F401 +except ImportError: + pytest.skip( + "Required jsonschema lib is not available.", + allow_module_level=True + ) + + +SCM_NG_0 = '''{ + "type": "object", + "properties": {"key_never_exist": {"type": "string", "required": true}} +}''' + + +def ipath_to_scm_path(ipath: pathlib.Path) -> typing.Optional[pathlib.Path]: + basename: str = ipath.name.replace(ipath.suffix, "") + candidates = list((ipath.parent / "s").glob(f"{basename}.*")) + if candidates: + return candidates[0] + + return None + + +NAMES: tuple[str, ...] = ("ipath", "exp", "opts", "scm") +DATA: list = [ + (i, e, o, ipath_to_scm_path(i)) for i, o, e + in common.load_data_for_testfile(__file__) +] +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_single_load(ipath, exp, opts, scm): + assert scm, f"Not found: {scm!s} [{ipath!s}" + assert TT.single_load(ipath, ac_schema=scm, **opts) == exp + + +@pytest.mark.parametrize( + ("ipath", "opts"), + [(ipath, opts) for ipath, _, opts, _ in DATA[:1]], + ids=DATA_IDS[:1] +) +def test_single_load_failures( + ipath, opts, tmp_path: pathlib.Path +) -> None: + scm = tmp_path / 'scm.json' + scm.write_text(SCM_NG_0) + + with warnings.catch_warnings(record=True) as warns: + warnings.simplefilter('always') + res = TT.single_load( + ipath, ac_schema=scm, ac_schema_safe=True, **opts + ) + assert res is None + assert len(warns) > 0 + assert issubclass(warns[-1].category, UserWarning) + assert 'scm=' in str(warns[-1].message) + + with pytest.raises(ValidationError): + TT.single_load(ipath, ac_schema=scm, ac_schema_safe=False) diff --git a/tests/api/single_load/test_template.py b/tests/api/single_load/test_template.py index d9815b4e..b422528a 100644 --- a/tests/api/single_load/test_template.py +++ b/tests/api/single_load/test_template.py @@ -1,59 +1,52 @@ # -# Copyright (C) 2012 - 2021 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring -import pathlib -import tempfile -import unittest +# pylint: disable=missing-docstring, unused-import +"""Test cases for anyconfig.api.single_load with template args.""" +from __future__ import annotations + import warnings -import anyconfig.template - -from . import common - - -@unittest.skipIf(not anyconfig.template.SUPPORTED, - 'jinja2 template lib is not available') -class TestCase(common.TestCase): - kind = 'template' - pattern = '*.j2' - - def test_single_load(self): - for data in self.each_data(): - self.assertEqual( - self.target_fn( - data.inp_path, ac_context=data.ctx, **data.opts - ), - data.exp, - f'{data.datadir!s}, {data.inp_path!s}' - ) - - def test_single_load_from_invalid_template(self): - with tempfile.TemporaryDirectory() as tdir: - wdir = pathlib.Path(tdir) - inp = wdir / 'test.json' - inp.write_text('{"a": "{{ a"}') # broken template string. - - with warnings.catch_warnings(record=True) as warns: - warnings.simplefilter('always') - res = self.target_fn( - inp, ac_template=True, ac_context=dict(a=1) - ) - self.assertEqual(res, dict(a='{{ a')) - self.assertTrue(len(warns) > 0) - self.assertTrue(issubclass(warns[-1].category, UserWarning)) - self.assertTrue('ailed to compile ' in str(warns[-1].message)) - - def test_single_load_intentional_failures(self): - ng_exp = dict(z=1, zz='zz', zzz=[1, 2, 3], zzzz=dict(z=0)) - for data in self.each_data(): - with self.assertRaises(AssertionError): - self.assertEqual( - self.target_fn( - data.inp_path, ac_context=data.ctx, **data.opts - ), - ng_exp - ) - -# vim:sw=4:ts=4:et: +import pytest + +import anyconfig.api._load as TT +try: + import anyconfig.template.jinja2 # noqa: F401 +except ImportError: + pytest.skip( + "Requried jinja2 lib is not available.", + allow_module_level=True + ) + +from ... import common + + +NAMES: tuple[str, ...] = ("ipath", "ctx", "exp", "opts") +DATA: list = common.load_data_for_testfile( + __file__, (("c", {}), ("e", None), ("o", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_single_load(ipath, ctx, exp, opts): + assert TT.single_load(ipath, ac_context=ctx, **opts) == exp + + +def test_single_load_from_invalid_template(tmp_path): + ipath = tmp_path / "test.json" + ipath.write_text('{"a": "{{ a"}') # broken template string. + + with warnings.catch_warnings(record=True) as warns: + warnings.simplefilter('always') + res = TT.single_load(ipath, ac_template=True, ac_context={"a": 1}) + + assert res == {"a": '{{ a'} + assert len(warns) > 0 + assert issubclass(warns[-1].category, UserWarning) + assert 'ailed to compile ' in str(warns[-1].message) diff --git a/tests/api/single_load/test_toml.py b/tests/api/single_load/test_toml.py new file mode 100644 index 00000000..102e6063 --- /dev/null +++ b/tests/api/single_load/test_toml.py @@ -0,0 +1,32 @@ +# +# Copyright (C) 2021 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Test cases for anyconfig.load with input of other file types.""" +from __future__ import annotations + +import pytest + +import anyconfig.api._load as TT + +from ... import common +from .constants import LOADER_TYPES + + +NAMES: tuple[str, ...] = ("ipath", "exp") +DATA: list = common.load_data_for_testfile(__file__, (("e", None), )) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.skipif( + "toml" not in LOADER_TYPES, + reason="toml lib is not availabla." +) +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_single_load_for_toml_files(ipath, exp): + assert TT.single_load(ipath) == exp diff --git a/tests/api/single_load/test_yaml.py b/tests/api/single_load/test_yaml.py new file mode 100644 index 00000000..aa2d8c1b --- /dev/null +++ b/tests/api/single_load/test_yaml.py @@ -0,0 +1,32 @@ +# +# Copyright (C) 2021 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Test cases for anyconfig.load with input of other file types.""" +from __future__ import annotations + +import pytest + +import anyconfig.api._load as TT + +from ... import common +from .constants import LOADER_TYPES + + +NAMES: tuple[str, ...] = ("ipath", "exp") +DATA: list = common.load_data_for_testfile(__file__, (("e", None), )) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data() -> None: + assert DATA + + +@pytest.mark.skipif( + "yaml" not in LOADER_TYPES, + reason="yaml loader is not availabla." +) +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_single_load_for_yaml_files(ipath, exp): + assert TT.single_load(ipath) == exp diff --git a/tests/api/test_utils.py b/tests/api/test_utils.py index ce1bb5ec..31687e4f 100644 --- a/tests/api/test_utils.py +++ b/tests/api/test_utils.py @@ -1,32 +1,31 @@ # -# Copyright (C) 2012 - 2021 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -r"""Test cases for anyconfig.utils.files. -""" +r"""Test cases for anyconfig.utils.files.""" import pathlib -import unittest + +import pytest import anyconfig.api.utils as TT from anyconfig.ioinfo import make as ioinfo_make -class TestCase(unittest.TestCase): - - def test_are_same_file_types(self): - fun = TT.are_same_file_types - this_py = pathlib.Path(__file__) - this = ioinfo_make(this_py) - other = ioinfo_make(this_py.parent / 'setup.cfg') +THIS_PY = pathlib.Path(__file__) +THIS = ioinfo_make(THIS_PY) +OTHER = ioinfo_make(THIS_PY.parent / "pyproject.toml") - for inp, exp in (([], False), - ([this], True), - ([this, this], True), - ([this, other], False), - ([this, other], False), - ): - (self.assertTrue if exp else self.assertFalse)(fun(inp)) -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize( + ("obj", "exp"), + (([], False), + ([THIS], True), + ([THIS, THIS], True), + ([THIS, OTHER], False), + ([THIS, OTHER], False), + ) +) +def test_are_same_file_types(obj, exp): + assert TT.are_same_file_types(obj) == exp diff --git a/tests/backend/base/test_parsers.py b/tests/backend/base/test_parsers.py index f6049d4d..b0fc90a5 100644 --- a/tests/backend/base/test_parsers.py +++ b/tests/backend/base/test_parsers.py @@ -1,10 +1,12 @@ # -# Copyright (C) 2012 - 2021 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring, invalid-name +# pylint: disable=missing-docstring,protected-access +"""Test cases for anyconfig.backend.base.parsers.""" +from __future__ import annotations + import pathlib -import unittest import anyconfig.backend.base.parsers as TT import anyconfig.ioinfo @@ -13,26 +15,23 @@ MZERO = TT.Parser()._container_factory()() -class TestCase(unittest.TestCase): - - def setUp(self): - self.psr = TT.Parser() +def test_type(): + assert TT.Parser().type() == str(TT.Parser._type) - def test_10_type(self): - self.assertEqual(self.psr.type(), str(TT.Parser._type)) - def test_20_loads__null_content(self): - cnf = self.psr.loads('') - self.assertEqual(cnf, MZERO) - self.assertTrue(isinstance(cnf, type(MZERO))) +def test_loads__null_content(): + psr = TT.Parser() + cnf = psr.loads('') + assert cnf == MZERO + assert isinstance(cnf, type(MZERO)) - def test_30_load__ac_ignore_missing(self): - cpath = pathlib.Path.cwd() / 'conf_file_not_exist.json' - assert not cpath.exists() - ioi = anyconfig.ioinfo.make(str(cpath)) - cnf = self.psr.load(ioi, ac_ignore_missing=True) - self.assertEqual(cnf, MZERO) - self.assertTrue(isinstance(cnf, type(MZERO))) +def test_load__ac_ignore_missing(): + cpath = pathlib.Path.cwd() / 'conf_file_not_exist.json' + assert not cpath.exists() -# vim:sw=4:ts=4:et: + psr = TT.Parser() + ioi = anyconfig.ioinfo.make(str(cpath)) + cnf = psr.load(ioi, ac_ignore_missing=True) + assert cnf == MZERO + assert isinstance(cnf, type(MZERO)) diff --git a/tests/backend/base/test_utils.py b/tests/backend/base/test_utils.py index 9f07a125..d523d61e 100644 --- a/tests/backend/base/test_utils.py +++ b/tests/backend/base/test_utils.py @@ -1,48 +1,36 @@ # -# Copyright (C) 2012 - 2021 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -"""Test cases for anyconfig.backend.base.utils. -""" -import pathlib -import tempfile -import unittest - -import anyconfig.backend.base.utils as TT - - -FILENAME = 'file_not_exist.txt' +"""Test cases for anyconfig.backend.base.utils.""" +from __future__ import annotations +import pathlib -class TestCase(unittest.TestCase): +import pytest - def test_not_implemented(self): - with self.assertRaises(NotImplementedError): - TT.not_implemented() +import anyconfig.backend.base.utils as TT - def test_ensure_outdir_exists_for_file_if_it_exists(self): - outdir = pathlib.Path.cwd() - outfile = outdir / FILENAME - TT.ensure_outdir_exists(outfile) - TT.ensure_outdir_exists(str(outfile)) - self.assertTrue(outdir.exists()) +FILENAME: str = "file_not_exist.txt" - def test_ensure_outdir_exists_for_file_if_it_does_not_exist(self): - with tempfile.TemporaryDirectory() as outdir: - outdir = pathlib.Path(outdir) - outpath = outdir / FILENAME - TT.ensure_outdir_exists(outpath) - self.assertTrue(outdir.exists()) +def test_not_implemented(): + with pytest.raises(NotImplementedError): + TT.not_implemented() - def test_ensure_outdir_exists_for_file_if_its_parent_does_not_exist(self): - with tempfile.TemporaryDirectory() as parent: - outdir = pathlib.Path(parent) / 'a' / 'b' / 'c' - outpath = outdir / FILENAME - TT.ensure_outdir_exists(outpath) - self.assertTrue(outdir.exists()) +@pytest.mark.parametrize( + ("rel_path", ), + ((FILENAME, ), + ("a/b/c", ), + ), +) +def test_ensure_outdir_exists( + rel_path: str, tmp_path: pathlib.Path +) -> None: + outpath = tmp_path / rel_path -# vim:sw=4:ts=4:et: + TT.ensure_outdir_exists(outpath) + assert outpath.parent.exists() diff --git a/tests/base/test_collector.py b/tests/base/test_collector.py index 173a3c13..7857bbd5 100644 --- a/tests/base/test_collector.py +++ b/tests/base/test_collector.py @@ -3,7 +3,9 @@ # SPDX-License-Identifier: MIT # # pylint: disable=invalid-name,missing-docstring -import unittest +"""Test cases for tests.base.collector.""" +from __future__ import annotations + import pathlib from . import collector as TT @@ -15,26 +17,19 @@ class Collector(TT.TDataCollector): # To avoid error because there are no files with '.json' file extension in # tests/res/base/basics/20/. - pattern = '*.*' + pattern = "*.*" should_exist = () # Likewise. -class TestCase(unittest.TestCase, Collector): - - def setUp(self): - self.init() - - def test_members(self): - self.assertTrue(self.target) - self.assertNotEqual(self.target, TT.TDataCollector.target) - self.assertEqual(self.target, CUR_DIR.name) +def test_members(): + obj = Collector() + obj.init() - self.assertTrue(self.root is not None) - self.assertEqual( - self.root, - CUR_DIR.parent / 'res' / self.target / self.kind - ) + assert obj.target + assert obj.target != TT.TDataCollector.target + assert obj.target == CUR_DIR.name - self.assertTrue(self.datasets) + assert obj.root is not None + assert obj.root == CUR_DIR.parent / "res" / obj.target / obj.kind -# vim:sw=4:ts=4:et: + assert obj.datasets diff --git a/tests/base/test_utils.py b/tests/base/test_utils.py index 68f5e17a..a50003da 100644 --- a/tests/base/test_utils.py +++ b/tests/base/test_utils.py @@ -1,112 +1,122 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring +"""Test cases for tests.base.utils.""" +from __future__ import annotations + import pathlib -import unittest +import typing + +import pytest from . import constants, utils as TT -RES_DIR = constants.RES_DIR / 'base' +RES_DIR = constants.RES_DIR / "base" SELF = pathlib.Path(__file__) -class TestCase(unittest.TestCase): - - def test_target_by_parent(self): - aes = [ - ((), 'base'), - ((__file__, ), 'base'), - ] - for args, exp in aes: - self.assertEqual(TT.target_by_parent(*args), exp) - - def test_load_from_py(self): - constants_py_path = SELF.parent / 'constants.py' - aes = [ - ((constants_py_path, ), constants.DATA), - ((str(constants_py_path), ), constants.DATA), - ((constants_py_path, 'RES_DIR'), constants.RES_DIR), - ] - for args, exp in aes: - self.assertEqual( - TT.load_from_py(*args), exp, - f'args: {args!r}, exp: {exp!r}' - ) - - def test_load_literal_data_from_py(self): - py_path = RES_DIR / 'basics' / '20' / '00.py' - exp = TT.json.load( - (RES_DIR / 'basics' / '10' / '00.json').open() - ) - aes = [ - (py_path, exp), - (str(py_path), exp), - ] - for arg, exp in aes: - self.assertEqual( - TT.load_literal_data_from_py(arg), exp - ) - - def test_maybe_data_path(self): - aes = [ - ((SELF.parent, SELF.stem, ), SELF), - ((pathlib.Path('/not/exist/dir'), 'foo', ), None), - ] - for args, exp in aes: - self.assertEqual(TT.maybe_data_path(*args), exp) - - def test_maybe_data_path_failures(self): - aes = [ - (SELF.parent, SELF.stem, (SELF.parent.name, ), '.xyz'), - ] - for args in aes: - with self.assertRaises(OSError): - TT.maybe_data_path(*args) - - def test_load_data(self): - aes = [ - ((None, ), {}), - ((None, 1), 1), - ((RES_DIR / 'basics' / '10' / '00.json', ), - TT.json.load((RES_DIR / 'basics' / '10' / '00.json').open()) - ), - ((RES_DIR / 'basics' / '20' / '00.py', ), - TT.json.load((RES_DIR / 'basics' / '10' / '00.json').open()) - ), - ((RES_DIR / 'basics' / '30' / '20.txt', ), - (RES_DIR / 'basics' / '10' / '20.json').read_text() - ), - ] - for args, exp in aes: - res = TT.load_data(*args) - self.assertEqual(res, exp, res) - - def test_load_data_failures(self): - aes = [ - (pathlib.Path('not_exist.xyz'), ), - ] - for args in aes: - with self.assertRaises(ValueError): - TT.load_data(*args) - - def test_load_datasets_from_dir(self): - aes = [ - ((RES_DIR / 'basics' / '10', '*.json'), 3), - ((RES_DIR / 'basics' / '20', '*.py'), 1), - ((RES_DIR / 'basics' / '30', '*.txt'), 3), - ] - for args, exp in aes: - res = TT.load_datasets_from_dir( - args[0], lambda *xs: xs[1], pattern=args[1] - ) - self.assertTrue(bool(res)) - self.assertEqual(len(res), exp) - - def test_load_datasets_from_dir_failures(self): - with self.assertRaises(ValueError): - _ = TT.load_datasets_from_dir(SELF, list) - -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize( + ("path", "exp"), + ((None, "base"), + (__file__, "base"), + ), +) +def test_target_by_parent(path: typing.Optional[str], exp: str): + if path is None: + assert TT.target_by_parent() == exp + else: + assert TT.target_by_parent(path) == exp + + +CONSTANTS_PY: pathlib.Path = SELF.parent / "constants.py" + + +@pytest.mark.parametrize( + ("args", "exp"), + (((CONSTANTS_PY, ), constants.DATA), + ((str(CONSTANTS_PY), ), constants.DATA), + ((CONSTANTS_PY, 'RES_DIR'), constants.RES_DIR), + ), +) +def test_load_from_py(args, exp): + assert TT.load_from_py(*args) == exp + + +def test_load_literal_data_from_py(): + py_path: pathlib.Path = RES_DIR / "basics" / "20" / "00.py" + exp = TT.json.load((RES_DIR / "basics" / "10" / "00.json").open()) + + assert TT.load_literal_data_from_py(py_path) == exp + assert TT.load_literal_data_from_py(str(py_path)) == exp + + +@pytest.mark.parametrize( + ("datadir", "name", "exp"), + ((SELF.parent, SELF.stem, SELF), + (pathlib.Path("/not/exist/dir"), "foo", None), + ), +) +def test_maybe_data_path(datadir, name, exp): + assert TT.maybe_data_path(datadir, name) == exp + + +@pytest.mark.parametrize( + ("args", ), + (((SELF.parent, SELF.stem, (SELF.parent.name, ), ".xyz"), ), + ), +) +def test_maybe_data_path_failures(args): + with pytest.raises(OSError): + TT.maybe_data_path(*args) + + +@pytest.mark.parametrize( + ("args", "exp"), + (((None, ), {}), + ((None, 1), 1), + ((RES_DIR / "basics" / "10" / "00.json", ), + TT.json.load((RES_DIR / "basics" / "10" / "00.json").open()) + ), + ((RES_DIR / "basics" / "20" / "00.py", ), + TT.json.load((RES_DIR / "basics" / "10" / "00.json").open()) + ), + ((RES_DIR / "basics" / "30" / "20.txt", ), + (RES_DIR / "basics" / "10" / "20.json").read_text() + ), + ), +) +def test_load_data(args, exp): + assert TT.load_data(*args) == exp + + +@pytest.mark.parametrize( + ("args", ), + (((pathlib.Path("not_exist.xyz"), ), ), + ), +) +def test_load_data_failures(args): + with pytest.raises(ValueError): + TT.load_data(*args) + + +@pytest.mark.parametrize( + ("args", "exp"), + (((RES_DIR / "basics" / "10", "*.json"), 3), + ((RES_DIR / "basics" / "20", "*.py"), 1), + ((RES_DIR / "basics" / "30", "*.txt"), 3), + ), +) +def test_load_datasets_from_dir(args, exp): + res = TT.load_datasets_from_dir( + args[0], lambda *xs: xs[1], pattern=args[1] + ) + assert bool(res) + assert len(res) == exp + + +def test_load_datasets_from_dir_failures(): + with pytest.raises(ValueError): + _ = TT.load_datasets_from_dir(SELF, list) diff --git a/tests/cli/collectors.py b/tests/cli/collectors.py deleted file mode 100644 index 0e1b38b7..00000000 --- a/tests/cli/collectors.py +++ /dev/null @@ -1,122 +0,0 @@ -# -# Copyright (C) 2021 - 2024 Satoru SATOH -# SPDX-License-Identifier: MIT -# -"""Provides base class to collect test data for cli test cases. -""" -from __future__ import annotations - -import pathlib - -from .. import base -from . import datatypes - - -class Collector(base.TDataCollector): - """Test data collector for test cases with no file outputs. - - .. seealso:: tests.base.collector.TDataCollector - """ - def load_dataset(self, datadir: pathlib.Path, inp: pathlib.Path): - """ - .. seealso:: tests.base.collector.TDataCollector.load_dataset - """ - name = inp.stem - opts = base.maybe_data_path(datadir / 'o', name, self.should_exist) - exp_data = base.load_data( - base.maybe_data_path(datadir / 'e', name, self.should_exist) - ) - outname = base.maybe_data_path(datadir / 'on', name, self.should_exist) - ref = base.maybe_data_path(datadir / 'r', name, self.should_exist) - oo_opts = base.maybe_data_path(datadir / 'oo', name, self.should_exist) - scm = base.maybe_data_path(datadir / 's', name, self.should_exist) - - return datatypes.TData( - datadir, - inp, - base.load_data(opts, default=[]), - datatypes.Expected(**exp_data), - base.load_data(outname, default=''), - base.load_data(ref), - base.load_data(oo_opts, default={}), - scm or None - ) - - -class MultiDataCollector(base.TDataCollector): - """Test data collector for test cases with no file outputs. - - .. seealso:: tests.base.collector.TDataCollector - """ - def load_data_from_dir(self, datadir: pathlib.Path): - """ - .. seealso:: tests.base.collector.TDataCollector.load_dataset - .. seealso:: tests.base.utils.each_data_from_dir - """ - if not datadir.is_dir(): - raise ValueError(f'Not look a data dir: {datadir!s}') - - # There should be multiple input files match with self.pattern. - inputs = sorted(datadir.glob(self.pattern)) - if not inputs: - raise ValueError(f'No any inputs in: {datadir!s}') - - for inp in inputs: - if not inp.is_file(): - raise ValueError(f'Not a file: {inp!s} in {datadir!s}') - - name = inputs[0].stem - - # Load a glob pattern or a list of inputs. - inp_data = base.load_data( - base.maybe_data_path(datadir / 'i', name, self.should_exist) - ) or '*.json' - - if isinstance(inp_data, list): - inputs = [datadir / i for i in inp_data] - else: - if not isinstance(inp_data, str): - raise ValueError(f'Invalid inputs: {inp_data} in {datadir!s}') - inputs = [datadir / inp_data] - - opts = base.maybe_data_path(datadir / 'o', name, self.should_exist) - exp_data = base.load_data( - base.maybe_data_path(datadir / 'e', name, self.should_exist) - ) - outname = base.maybe_data_path(datadir / 'on', name, self.should_exist) - ref = base.maybe_data_path(datadir / 'r', name, self.should_exist) - oo_opts = base.maybe_data_path(datadir / 'oo', name, self.should_exist) - scm = base.maybe_data_path(datadir / 's', name, self.should_exist) - - return datatypes.TDataSet( - datadir, - inputs, - base.load_data(opts, default=[]), - datatypes.Expected(**exp_data), - base.load_data(outname, default=''), - base.load_data(ref), - base.load_data(oo_opts, default={}), - scm or None - ) - - def load_datasets(self) -> list[datatypes.TData]: - """Load test data from files. - """ - _datasets = [ - (datadir, [self.load_data_from_dir(datadir)]) - for datadir in sorted(self.root.glob('*')) - ] - if not _datasets: - raise ValueError(f'No data: {self.root!s}') - - for datadir, data in _datasets: - if not data: - raise ValueError( - f'No data in subdir: {datadir!s}, ' - f'pattern={self.pattern}, ' - f'should_exist={self.should_exist!r}' - ) - - return _datasets - -# vim:sw=4:ts=4:et: diff --git a/tests/cli/common.py b/tests/cli/common.py new file mode 100644 index 00000000..7f86d837 --- /dev/null +++ b/tests/cli/common.py @@ -0,0 +1,82 @@ +# +# Copyright (C) 2013 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +"""Common constants and functions for test cases of anyconfig.cli.""" +from __future__ import annotations + +import contextlib +import io +import pathlib +import sys +import typing + +import pytest + +import anyconfig.api +import anyconfig.cli as TT + +from . import datatypes + + +def _run_main( + tdata: datatypes.TData, tmp_path: pathlib.Path +) -> None: + args = ["anyconfig_cli", *tdata.opts, *tdata.ipaths] + + if tdata.outname: # Running cli.main will output files. + assert tdata.ref is not None + opath = tmp_path / tdata.outname + + # Run anyconfig.cli.main with arguments. + TT.main([*args, "-o", str(opath)]) + + if tdata.exp.exit_code_matches and tdata.exp.exit_code == 0: + assert opath.exists() + + try: + odata = anyconfig.api.load(opath, **tdata.oo_opts) + except anyconfig.api.UnknownFileTypeError: + odata = anyconfig.api.load(opath, ac_parser='json') + + assert odata == tdata.ref, f"{odata} vs. {tdata.ref!r}" + else: + # Likewise but without -o option. + TT.main(args) + + sys.exit(0) + + +def run_main( + tdata: datatypes.TData, tmp_path: pathlib.Path, + post_checks: typing.Optional[typing.Callable] = None +) -> None: + """Run anyconfig.cli.main and check if the exit code was expected one. + """ + expected: datatypes.Expected = tdata.exp + + with pytest.raises(expected.exception) as exci: + with contextlib.redirect_stdout(io.StringIO()) as stdout: + with contextlib.redirect_stderr(io.StringIO()) as stderr: + _run_main(tdata, tmp_path) + + assert isinstance(exci.value, expected.exception) + ecode = getattr( + exci.value, "error_code", getattr(exci.value, "code", 1) + ) + + if post_checks is not None: + post_checks(tdata, stdout, stderr) + + log = f"ecode: {ecode!r}, expected: {expected!r}, opts: {tdata.opts}" + if expected.exit_code_matches: + assert ecode == expected.exit_code, log + else: + assert ecode != expected.exit_code, log + + if expected.words_in_stdout: + assert expected.words_in_stdout in stdout.getvalue() + + if expected.words_in_stderr: + assert expected.words_in_stderr in stderr.getvalue() diff --git a/tests/cli/datatypes.py b/tests/cli/datatypes.py index 5166455b..d02ae92d 100644 --- a/tests/cli/datatypes.py +++ b/tests/cli/datatypes.py @@ -2,39 +2,37 @@ # Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -"""Basic data types for file based test data collectors. -""" +"""Basic data types for file based test data loaders.""" from __future__ import annotations import pathlib import typing -DictT = dict[str, typing.Any] +DictType = dict[str, typing.Any] class Expected(typing.NamedTuple): - """Keeps expected result's info. - """ + """Keeps expected result's information.""" exit_code: int = 0 exit_code_matches: bool = True - words_in_stdout: str = '' - words_in_stderr: str = '' + words_in_stdout: str = "" + words_in_stderr: str = "" exception: BaseException = SystemExit class TData(typing.NamedTuple): - """A namedtuple object keeps test data to test cases with no file outputs. + """A namedtuple object keeps test data for test cases with no file outputs. """ - datadir: pathlib.Path - inp_path: pathlib.Path + ipath: pathlib.Path + ipaths: list[str] = [] opts: list[str] = [] exp: Expected = Expected() # Optional extra data. - outname: str = '' - ref: typing.Optional[DictT] = None - oo_opts: DictT = {} + outname: str = "" + ref: typing.Optional[DictType] = None + oo_opts: DictType = {} scm: typing.Optional[pathlib.Path] = None @@ -47,7 +45,7 @@ class TDataSet(typing.NamedTuple): exp: Expected = Expected() # Likewise. - outname: str = '' - ref: typing.Optional[DictT] = None - oo_opts: DictT = {} + outname: str = "" + ref: typing.Optional[DictType] = None + oo_opts: DictType = {} scm: typing.Optional[pathlib.Path] = None diff --git a/tests/cli/test_base.py b/tests/cli/test_base.py deleted file mode 100644 index bc897090..00000000 --- a/tests/cli/test_base.py +++ /dev/null @@ -1,121 +0,0 @@ -# -# Copyright (C) 2013 - 2024 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring -"""test cases for anyconfig.cli module. -""" -from __future__ import annotations - -import contextlib -import io -import pathlib -import sys -import tempfile -import unittest - -import anyconfig.api -import anyconfig.cli as TT - -from .. import base -from . import collectors, datatypes - - -def make_args(_self, tdata): - """Make arguments to run cli.main. - """ - return ['anyconfig_cli'] + tdata.opts + [str(tdata.inp_path)] - - -class BaseTestCase(unittest.TestCase): - """Base Test case. - """ - collector = collectors.Collector() - make_args = make_args - - def setUp(self): - if self.collector: - self.collector.init() - - def post_checks(self, tdata, *args, **kwargs): - """Placeholder to do more post checks. - """ - pass - - def _run_main(self, tdata): - """Wrapper for cli.main.""" - args = self.make_args(tdata) - - if tdata.outname: # Running cli.main will output files. - self.assertTrue( - tdata.ref is not None, - 'No reference data was given, {tdata!r}' - ) - with tempfile.TemporaryDirectory() as tdir: - opath = pathlib.Path(tdir) / tdata.outname - - # Run anyconfig.cli.main with arguments. - TT.main(args + ['-o', str(opath)]) - - if tdata.exp.exit_code_matches and tdata.exp.exit_code == 0: - self.assertTrue(opath.exists(), str(opath)) - - try: - odata = anyconfig.api.load(opath, **tdata.oo_opts) - except anyconfig.api.UnknownFileTypeError: - odata = anyconfig.api.load(opath, ac_parser='json') - self.assertEqual(odata, tdata.ref, repr(tdata)) - - self.post_checks(tdata, opath) - else: - # Likewise but without -o option. - TT.main(args) - self.post_checks(tdata) - - sys.exit(0) - - def run_main(self, tdata) -> None: - """ - Run anyconfig.cli.main and check if the exit code was expected one. - """ - expected: datatypes.Expected = tdata.exp - - with self.assertRaises(expected.exception, msg=repr(tdata)) as ctx: - with contextlib.redirect_stdout(io.StringIO()) as stdout: - with contextlib.redirect_stderr(io.StringIO()) as stderr: - self._run_main(tdata) - - exc = ctx.exception - self.assertTrue(isinstance(exc, expected.exception)) - ecode = getattr(exc, 'error_code', getattr(exc, 'code', 1)) - if expected.exit_code_matches: - self.assertEqual(ecode, expected.exit_code, f'{tdata!r}') - else: - self.assertNotEqual(ecode, expected.exit_code, f'{tdata!r}') - - if expected.words_in_stdout: - msg = stdout.getvalue() - self.assertTrue(expected.words_in_stdout in msg, msg) - - if expected.words_in_stderr: - err = stderr.getvalue() - self.assertTrue(expected.words_in_stderr in err, err) - - def test_runs_for_datasets(self) -> None: - if self.collector and self.collector.initialized: - if self.collector.kind == base.TDataCollector.kind: - return - - for tdata in self.collector.each_data(): - self.run_main(tdata) - - -class NoInputTestCase(BaseTestCase): - """Test cases which does not require inputs. - """ - def make_args(self, tdata): # pylint: disable=no-self-use - """Make arguments to run cli.main. - """ - return ['anyconfig_cli'] + tdata.opts - -# vim:sw=4:ts=4:et: diff --git a/tests/cli/test_detectors.py b/tests/cli/test_detectors.py index da9790f4..7268275f 100644 --- a/tests/cli/test_detectors.py +++ b/tests/cli/test_detectors.py @@ -1,101 +1,113 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -"""test cases of anyconfig.cli.detectors. -""" +"""test cases of anyconfig.cli.detectors.""" +from __future__ import annotations + import contextlib import io -import unittest import warnings +import typing + +import pytest import anyconfig.cli.detectors as TT import anyconfig.cli.parse_args -class TestCase(unittest.TestCase): - - def test_are_same_file_types(self): - ies = (([], False), - (['/tmp/a/b/c.conf'], True), - (['/tmp/a/b/c.yml', '/tmp/a/b/d.yml'], True), - ) - for inp, exp in ies: - (self.assertTrue if exp else self.assertFalse)( - TT.are_same_file_types(inp) - ) - - def test_find_by_the_type(self): - ies = (('', None), - (None, None), - ('json', 'json'), - ('type_not_exit', None), - ) - with warnings.catch_warnings(): - warnings.simplefilter('ignore') - for inp, exp in ies: - self.assertEqual( - TT.find_by_the_type(inp), exp - ) - - def test_find_by_the_paths(self): - ies = (([], None), - (['/tmp/a/b/c.yml', '/tmp/a/b/d.json'], None), - (['-'], None), - (['-', '/tmp/a/b/d.json'], None), - (['/tmp/a/b/c.json', '/tmp/a/b/d.json'], 'json'), - ) - for inp, exp in ies: - self.assertEqual( - TT.find_by_the_paths(inp), exp - ) - - def test_try_detecting_input_type(self): - ies = (([], None), - (['-'], None), - (['a.conf'], None), - (['-I', 'json', 'a.conf'], 'json'), - (['a.json'], 'json'), - ) - for inp, exp in ies: - (_psr, args) = anyconfig.cli.parse_args.parse( - inp, prog='anyconfig_cli' - ) - self.assertEqual( - TT.try_detecting_input_type(args), exp, args - ) - - def test_try_detecting_output_type(self): - ies = ((['-I', 'json', 'a.conf'], 'json'), - (['a.json'], 'json'), - (['-I', 'json', 'a.conf', '-o', 'b.conf'], 'json'), - (['a.json', '-o', 'b.conf'], 'json'), - (['a.json', '-O', 'json', '-o', 'b.conf'], 'json'), - ) - for inp, exp in ies: - (_psr, args) = anyconfig.cli.parse_args.parse( - inp, prog='anyconfig_cli' - ) - self.assertEqual( - TT.try_detecting_output_type(args), exp, args - ) - - def test_try_detecting_output_type__failures(self): - ies = (['-'], - ['a.conf'], - ['a.conf', '-o', 'b.conf'], - ) - with warnings.catch_warnings(): - warnings.simplefilter('ignore') - - for inp in ies: - (_psr, args) = anyconfig.cli.parse_args.parse( - inp, prog='anyconfig_cli' - ) - with self.assertRaises(SystemExit): - with contextlib.redirect_stdout(io.StringIO()): - with contextlib.redirect_stderr(io.StringIO()): - TT.try_detecting_output_type(args) - -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize( + ("paths", "exp"), + (([], False), + (['/tmp/a/b/c.conf'], True), + (['/tmp/a/b/c.yml', '/tmp/a/b/d.yml'], True), + ) +) +def test_are_same_file_types(paths: list[str], exp: bool) -> None: + assert TT.are_same_file_types(paths) == exp + + +@pytest.mark.parametrize( + ("typ", "exp"), + (('', None), + (None, None), + ('json', 'json'), + ('type_not_exit', None), + ) +) +def test_find_by_the_type(typ: str, exp: typing.Optional[str]): + with warnings.catch_warnings(): + warnings.simplefilter('ignore') + assert TT.find_by_the_type(typ) == exp + + +@pytest.mark.parametrize( + ("paths", "exp"), + (([], None), + (['/tmp/a/b/c.yml', '/tmp/a/b/d.json'], None), + (['-'], None), + (['-', '/tmp/a/b/d.json'], None), + (['/tmp/a/b/c.json', '/tmp/a/b/d.json'], 'json'), + ) +) +def test_find_by_the_paths( + paths: list[str], exp: typing.Optional[str] +) -> None: + assert TT.find_by_the_paths(paths) == exp + + +@pytest.mark.parametrize( + ("argv", "exp"), + (([], None), + (['-'], None), + (['a.conf'], None), + (['-I', 'json', 'a.conf'], 'json'), + (['a.json'], 'json'), + ) +) +def test_try_detecting_input_type( + argv: list[str], exp: typing.Optional[str] +) -> None: + (_psr, args) = anyconfig.cli.parse_args.parse( + argv, prog='anyconfig_cli' + ) + assert TT.try_detecting_input_type(args) == exp + + +@pytest.mark.parametrize( + ("argv", "exp"), + ((['-I', 'json', 'a.conf'], 'json'), + (['a.json'], 'json'), + (['-I', 'json', 'a.conf', '-o', 'b.conf'], 'json'), + (['a.json', '-o', 'b.conf'], 'json'), + (['a.json', '-O', 'json', '-o', 'b.conf'], 'json'), + ) +) +def test_try_detecting_output_type( + argv: list[str], exp: typing.Optional[str] +) -> None: + (_psr, args) = anyconfig.cli.parse_args.parse( + argv, prog='anyconfig_cli' + ) + assert TT.try_detecting_output_type(args) == exp + + +@pytest.mark.parametrize( + ("argv", ), + ((['-'], ), + (['a.conf'], ), + (['a.conf', '-o', 'b.conf'], ), + ) +) +def test_try_detecting_output_type__failures(argv: list[str]) -> None: + with warnings.catch_warnings(): + warnings.simplefilter('ignore') + + (_psr, args) = anyconfig.cli.parse_args.parse( + argv, prog='anyconfig_cli' + ) + with pytest.raises(SystemExit): + with contextlib.redirect_stdout(io.StringIO()): + with contextlib.redirect_stderr(io.StringIO()): + TT.try_detecting_output_type(args) diff --git a/tests/cli/test_errors.py b/tests/cli/test_errors.py index 8f739dc4..6ac45a43 100644 --- a/tests/cli/test_errors.py +++ b/tests/cli/test_errors.py @@ -1,25 +1,40 @@ # -# Copyright (C) 2013 - 2021 Satoru SATOH +# Copyright (C) 2013 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -"""test cases of anyconfig.cli.main without arguments and cause errors. -""" -from .. import base -from . import collectors, test_base +"""test cases of anyconfig.cli.main without arguments and cause errors.""" +from __future__ import annotations +import typing -class Collector(collectors.Collector): - kind = 'errors' +import pytest +from .. import common +from . import datatypes +from .common import run_main -class TestCase(test_base.BaseTestCase): - collector = Collector() +if typing.TYPE_CHECKING: + import pathlib - def make_args(self, tdata): # pylint: disable=no-self-use - """Make arguments to run cli.main. - """ - args = base.load_data(tdata.inp_path, default=[]) - return ['anyconfig_cli'] + tdata.opts + args -# vim:sw=4:ts=4:et: +NAMES: list[str] = ("ipath", "ipaths", "opts", "exp") +DATA = common.load_data_for_testfile( + __file__, values=(("o", []), ("e", None)), load_idata=True +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data(): + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_cli( + ipath: pathlib.Path, ipaths: list[str], opts: list[str], exp: dict, + tmp_path: pathlib.Path +) -> None: + expected = datatypes.Expected(**exp) + tdata = datatypes.TData(ipath, ipaths, opts, expected) + + run_main(tdata, tmp_path) diff --git a/tests/cli/test_extra_options.py b/tests/cli/test_extra_options.py index 5450e495..f8d7117a 100644 --- a/tests/cli/test_extra_options.py +++ b/tests/cli/test_extra_options.py @@ -1,31 +1,42 @@ # -# Copyright (C) 2013 - 2021 Satoru SATOH +# Copyright (C) 2013 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -"""test cases of anyconfig.cli.main with schema options. -""" -from .. import base -from . import collectors, test_base +# pylint: disable=too-many-arguments +"""Test cases of anyconfig.cli.main with extra options.""" +from __future__ import annotations +import typing -class Collector(collectors.Collector): - kind = 'extra_options' +import pytest +from .. import common +from . import datatypes +from .common import run_main -class TestCase(test_base.BaseTestCase): - collector = Collector() +if typing.TYPE_CHECKING: + import pathlib - def post_checks(self, tdata, *args, **kwargs): - """Post checks to compare the outputs of ref. and result. - .. seealso:: tests.cli.test_base.BaseTestCase._run_main - """ - ref_path = base.maybe_data_path( - tdata.datadir / 'r', tdata.inp_path.stem - ) - ref = ref_path.read_text().strip().rstrip() - out = args[0].read_text().strip().rstrip() - self.assertEqual(out, ref) +NAMES: list[str] = ("ipath", "opts", "exp", "oname", "ref") +DATA = common.load_data_for_testfile( + __file__, values=(("o", []), ("e", None), ("on", ""), ("r", None)) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) -# vim:sw=4:ts=4:et: + +def test_data(): + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_cli( + ipath: pathlib.Path, opts: list[str], exp: dict, oname: str, ref, + tmp_path: pathlib.Path +) -> None: + expected = datatypes.Expected(**exp) + tdata = datatypes.TData( + ipath, [str(ipath)], opts, expected, oname, ref + ) + run_main(tdata, tmp_path) diff --git a/tests/cli/test_ignore_missing.py b/tests/cli/test_ignore_missing.py index 51a7e374..972d0e16 100644 --- a/tests/cli/test_ignore_missing.py +++ b/tests/cli/test_ignore_missing.py @@ -1,23 +1,43 @@ # -# Copyright (C) 2013 - 2021 Satoru SATOH +# Copyright (C) 2013 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring -"""test cases of anyconfig.cli.main of which input does not exist but ignored. -""" -from . import collectors, test_base +# pylint: disable=missing-docstring, too-many-arguments +"""Test cases of anyconfig.cli.main with ignore-missing option.""" +from __future__ import annotations +import typing -class Collector(collectors.Collector): - kind = 'ignore_missing' +import pytest +from .. import common +from . import datatypes +from .common import run_main -class TestCase(test_base.BaseTestCase): - collector = Collector() +if typing.TYPE_CHECKING: + import pathlib - def make_args(self, tdata): # pylint: disable=no-self-use - """Make arguments to run cli.main. - """ - return ['anyconfig_cli'] + tdata.opts + ['file_not_exist.json'] -# vim:sw=4:ts=4:et: +NAMES: list[str] = ("ipath", "ipaths", "opts", "exp", "oname", "ref") +DATA = common.load_data_for_testfile( + __file__, values=(("o", []), ("e", None), ("on", ""), ("r", None)), + load_idata=True +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data(): + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_cli( + ipath: pathlib.Path, ipaths: list[str], opts: list[str], exp: dict, + oname: str, ref, + tmp_path: pathlib.Path +) -> None: + expected = datatypes.Expected(**exp) + tdata = datatypes.TData( + ipath, [*ipaths, "file_not_exist.json"], opts, expected, oname, ref + ) + run_main(tdata, tmp_path) diff --git a/tests/cli/test_multi_inputs.py b/tests/cli/test_multi_inputs.py index 23a2588c..34ee3adc 100644 --- a/tests/cli/test_multi_inputs.py +++ b/tests/cli/test_multi_inputs.py @@ -1,23 +1,43 @@ # -# Copyright (C) 2013 - 2021 Satoru SATOH +# Copyright (C) 2013 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring -"""test cases of anyconfig.cli.main with multiple inputs. -""" -from . import collectors, test_base +# pylint: disable=missing-docstring, too-many-arguments +"""Test cases of anyconfig.cli.main with ignore-missing option.""" +from __future__ import annotations +import typing -class Collector(collectors.MultiDataCollector): - kind = 'multi_inputs' +import pytest +from .. import common +from . import datatypes +from .common import run_main -class TestCase(test_base.BaseTestCase): - collector = Collector() +if typing.TYPE_CHECKING: + import pathlib - def make_args(self, tdata): # pylint: disable=no-self-use - """Make arguments to run cli.main. - """ - return ['anyconfig_cli'] + tdata.opts + [str(p) for p in tdata.inputs] -# vim:sw=4:ts=4:et: +NAMES: list[str] = ("ipath", "opts", "exp", "oname", "ref") +DATA = [ + (i, o, e, on, r) for i, o, e, on, r + in common.load_data_for_testfile( + __file__, values=(("o", []), ("e", {}), ("on", ""), ("r", None)), + ) if on +] +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data(): + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_cli( + ipath: pathlib.Path, opts: list[str], exp: dict, oname: str, ref, + tmp_path: pathlib.Path +) -> None: + expected = datatypes.Expected(**exp) + ipaths = sorted(str(p) for p in ipath.parent.glob("*.*")) + tdata = datatypes.TData(ipath, ipaths, opts, expected, oname, ref) + run_main(tdata, tmp_path) diff --git a/tests/cli/test_parse_args.py b/tests/cli/test_parse_args.py index 49efef97..ebcfda53 100644 --- a/tests/cli/test_parse_args.py +++ b/tests/cli/test_parse_args.py @@ -1,33 +1,26 @@ # -# Copyright (C) 2013 - 2021 Satoru SATOH +# Copyright (C) 2013 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring, invalid-name, too-many-public-methods -"""test cases of anyconfig.cli.main without arguments. -""" -import unittest +# pylint: disable=missing-docstring +"""Test cases of anyconfig.cli.main without arguments.""" +from __future__ import annotations import anyconfig.cli.parse_args as TT -class TestCase(unittest.TestCase): +def test_make_parser() -> None: + psr = TT.make_parser() + assert isinstance(psr, TT.argparse.ArgumentParser) - def test_make_parser(self): - psr = TT.make_parser() - self.assertTrue( - isinstance(psr, TT.argparse.ArgumentParser) - ) - - # ref = TT.DEFAULTS.copy() - ref = dict( - args=None, atype=None, env=False, extra_opts=None, - gen_schema=False, get=None, ignore_missing=False, inputs=[], - itype=None, list=False, loglevel=0, merge='merge_dicts', - otype=None, output=None, query=None, schema=None, set=None, - template=False, validate=False - ) - self.assertEqual( - vars(psr.parse_args([])), ref - ) - -# vim:sw=4:ts=4:et: + # ref = TT.DEFAULTS.copy() + ref = { + "args": None, "atype": None, "env": False, + "extra_opts": None, "gen_schema": False, + "get": None, "ignore_missing": False, "inputs": [], + "itype": None, "list": False, "loglevel": 0, + "merge": 'merge_dicts', "otype": None, "output": None, + "query": None, "schema": None, "set": None, + "template": False, "validate": False + } + assert vars(psr.parse_args([])) == ref diff --git a/tests/cli/test_query.py b/tests/cli/test_query.py index ea3f014c..33dfc114 100644 --- a/tests/cli/test_query.py +++ b/tests/cli/test_query.py @@ -1,24 +1,48 @@ # -# Copyright (C) 2013 - 2021 Satoru SATOH +# Copyright (C) 2013 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring -"""test cases of anyconfig.cli.main to query using JMESPath expression. -""" -import unittest +# pylint: disable=missing-docstring, too-many-arguments +# pylint: disable=unused-import +"""Test cases of anyconfig.cli.main with query option.""" +from __future__ import annotations -import anyconfig.query +import typing -from . import collectors, test_base +import pytest +try: + import anyconfig.query.query # noqa: F401 +except ImportError: + pytest.skip( + "Required query module is not available", + allow_module_level=True + ) -class Collector(collectors.Collector): - kind = 'query' +from .. import common +from . import datatypes +from .common import run_main +if typing.TYPE_CHECKING: + import pathlib -@unittest.skipIf(not anyconfig.query.SUPPORTED, - 'Library to query using JMESPath is not available') -class TestCase(test_base.BaseTestCase): - collector = Collector() -# vim:sw=4:ts=4:et: +NAMES: list[str] = ("ipath", "opts", "exp", "oname", "ref") +DATA = common.load_data_for_testfile( + __file__, values=(("o", []), ("e", {}), ("on", ""), ("r", None)) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data(): + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_cli( + ipath: pathlib.Path, opts: list[str], exp: dict, oname: str, ref, + tmp_path: pathlib.Path +) -> None: + expected = datatypes.Expected(**exp) + tdata = datatypes.TData(ipath, [str(ipath)], opts, expected, oname, ref) + run_main(tdata, tmp_path) diff --git a/tests/cli/test_schema.py b/tests/cli/test_schema.py index b6e34bd3..ea29a1bd 100644 --- a/tests/cli/test_schema.py +++ b/tests/cli/test_schema.py @@ -2,50 +2,54 @@ # Copyright (C) 2013 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring -"""test cases of anyconfig.cli.main with schema options. -""" -import unittest -import warnings +# pylint: disable=missing-docstring, too-many-arguments +"""Test cases of anyconfig.cli.main with ignore-missing option.""" +from __future__ import annotations -import anyconfig.schema +import typing +import warnings -from . import collectors, test_base +import pytest +import anyconfig.schema -ERR = 'Library for JSON schema validation is not available' +from .. import common +from . import datatypes +from .common import run_main +if typing.TYPE_CHECKING: + import pathlib -class Collector(collectors.Collector): - kind = 'schema' +if not anyconfig.schema.SUPPORTED: + pytest.skip( + "Library for JSON schema validation is not available", + allow_module_level=True + ) -@unittest.skipIf( - "jsonschema" not in anyconfig.schema.VALIDATORS, ERR +NAMES: list[str] = ("ipath", "opts", "exp") +DATA = common.load_data_for_testfile( + __file__, values=(("o", []), ("e", {})) ) -class TestCase(test_base.BaseTestCase): - collector = Collector() - - def make_args(self, tdata): # pylint: disable=no-self-use - """Make arguments to run cli.main. - """ - return [ - 'anyconfig_cli', '--validate', '--schema', str(tdata.scm), - str(tdata.inp_path), *tdata.opts - ] +DATA_IDS: list[str] = common.get_test_ids(DATA) - def _run_main(self, tdata): - """Override it to suppress some warnings. - """ - with warnings.catch_warnings(): - warnings.simplefilter('ignore') - super()._run_main(tdata) +def test_data(): + assert DATA -class SchemaErrorsCollector(collectors.Collector): - kind = 'schema_errors' +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_cli( + ipath: pathlib.Path, opts: list[str], exp: dict, + tmp_path: pathlib.Path +) -> None: + scm = list((ipath.parent / "s").glob("*.*"))[0] + sopts = ["--schema", str(scm)] -@unittest.skipIf(not anyconfig.schema.SUPPORTED, ERR) -class SchemaErrorsTestCase(test_base.BaseTestCase): - collector = SchemaErrorsCollector() + expected = datatypes.Expected(**exp) + tdata = datatypes.TData( + ipath, [str(ipath)], [*opts, *sopts], expected + ) + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + run_main(tdata, tmp_path) diff --git a/tests/cli/test_schema_errors.py b/tests/cli/test_schema_errors.py new file mode 100644 index 00000000..b7557133 --- /dev/null +++ b/tests/cli/test_schema_errors.py @@ -0,0 +1,50 @@ +# +# Copyright (C) 2013 - 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring, too-many-arguments +"""Test cases of anyconfig.cli.main with invalid schema option.""" +from __future__ import annotations + +import typing +import warnings + +import pytest + +import anyconfig.schema + +from .. import common +from . import datatypes +from .common import run_main + +if typing.TYPE_CHECKING: + import pathlib + +if not anyconfig.schema.SUPPORTED: + pytest.skip( + "Library for JSON schema validation is not available", + allow_module_level=True + ) + + +NAMES: list[str] = ("ipath", "opts", "exp") +DATA = common.load_data_for_testfile( + __file__, values=(("o", []), ("e", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data(): + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_cli( + ipath: pathlib.Path, opts: list[str], exp: dict, + tmp_path: pathlib.Path +) -> None: + expected = datatypes.Expected(**exp) + tdata = datatypes.TData(ipath, [str(ipath)], opts, expected) + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + run_main(tdata, tmp_path) diff --git a/tests/cli/test_show.py b/tests/cli/test_show.py index 4fef430b..a5c7954c 100644 --- a/tests/cli/test_show.py +++ b/tests/cli/test_show.py @@ -1,37 +1,46 @@ # -# Copyright (C) 2013 - 2021 Satoru SATOH +# Copyright (C) 2013 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring -"""test cases of anyconfig.cli.main without arguments to show info. -""" -import anyconfig.api +# pylint: disable=missing-docstring, too-many-arguments +"""Test cases of anyconfig.cli.main without arguments to show info.""" +from __future__ import annotations -from . import collectors, datatypes, test_base +import typing +import pytest -class Collector(collectors.Collector): - kind = 'show' +import anyconfig.schema +from .. import common +from . import datatypes +from .common import run_main -class TestCase(test_base.NoInputTestCase): - collector = Collector() +if typing.TYPE_CHECKING: + import pathlib +if not anyconfig.schema.SUPPORTED: + pytest.skip( + "Library for JSON schema validation is not available", + allow_module_level=True + ) -class VersionCollector(collectors.Collector): - kind = 'show_version' - def load_dataset(self, datadir, inp): - ver = '.'.join(anyconfig.api.version()) - tdata = super().load_dataset(datadir, inp) +NAMES: list[str] = ("ipath", "opts", "exp") +DATA = common.load_data_for_testfile( + __file__, values=(("o", []), ("e", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) - return datatypes.TData( - tdata.datadir, tdata.inp_path, tdata.opts, - datatypes.Expected(words_in_stdout=ver) - ) +def test_data(): + assert DATA -class VersionTestCase(test_base.NoInputTestCase): - collector = VersionCollector() -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_cli( + ipath: pathlib.Path, opts: list[str], exp: dict, tmp_path +) -> None: + expected = datatypes.Expected(**exp) + tdata = datatypes.TData(ipath, [], opts, expected) + run_main(tdata, tmp_path) diff --git a/tests/cli/test_single_input.py b/tests/cli/test_single_input.py index dd5bcd5f..69bb0b21 100644 --- a/tests/cli/test_single_input.py +++ b/tests/cli/test_single_input.py @@ -1,18 +1,52 @@ # -# Copyright (C) 2013 - 2021 Satoru SATOH +# Copyright (C) 2013 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring -"""test cases of anyconfig.cli.main without arguments and cause errors. -""" -from . import collectors, test_base +# pylint: disable=missing-docstring, too-many-arguments +"""Test cases of anyconfig.cli.main with sinngle file innputs.""" +from __future__ import annotations +import typing -class Collector(collectors.Collector): - kind = 'single_input' +import pytest +import anyconfig.schema -class TestCase(test_base.BaseTestCase): - collector = Collector() +from .. import common +from . import datatypes +from .common import run_main -# vim:sw=4:ts=4:et: +if typing.TYPE_CHECKING: + import pathlib + +if not anyconfig.schema.SUPPORTED: + pytest.skip( + "Library for JSON schema validation is not available", + allow_module_level=True + ) + + +NAMES: list[str] = ("ipath", "opts", "exp", "oname", "ref", "oopts") +DATA = common.load_data_for_testfile( + __file__, + values=(("o", []), ("e", {}), ("on", ""), ("r", {}), ("oo", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) + + +def test_data(): + assert DATA + + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_cli( + ipath: pathlib.Path, opts: list[str], exp: dict, + oname: str, ref: dict, oopts: dict, + tmp_path: pathlib.Path +) -> None: + expected = datatypes.Expected(**exp) + tdata = datatypes.TData( + ipath, [str(ipath)], opts, expected, + outname=oname, ref=ref, oo_opts=oopts + ) + run_main(tdata, tmp_path) diff --git a/tests/cli/test_single_input_to_yaml_output.py b/tests/cli/test_single_input_to_yaml_output.py index 66d77ac2..c5f64799 100644 --- a/tests/cli/test_single_input_to_yaml_output.py +++ b/tests/cli/test_single_input_to_yaml_output.py @@ -1,25 +1,52 @@ # -# Copyright (C) 2013 - 2021 Satoru SATOH +# Copyright (C) 2013 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring -""" -Test cases of anyconfig.cli.main to load single input with support -using extra libraries. -""" -import unittest +# pylint: disable=missing-docstring, too-many-arguments +"""Test cases of anyconfig.cli.main with yaml output option.""" +from __future__ import annotations + +import typing + +import pytest import anyconfig.api -from . import collectors, test_base +from .. import common +from . import datatypes +from .common import run_main + +if typing.TYPE_CHECKING: + import pathlib + +if "yaml" not in anyconfig.api.list_types(): + pytest.skip( + "YAML support library is not available", + allow_module_level=True + ) + + +NAMES: list[str] = ("ipath", "opts", "exp", "oname", "ref", "oopts") +DATA = common.load_data_for_testfile( + __file__, + values=(("o", []), ("e", {}), ("on", ""), ("r", {}), ("oo", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) -class Collector(collectors.Collector): - kind = 'single_input_to_yaml_output' +def test_data(): + assert DATA -@unittest.skipIf('yaml' not in anyconfig.api.list_types(), - 'loading and dumping yaml support is not available') -class TestCase(test_base.BaseTestCase): - collector = Collector() -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_cli( + ipath: pathlib.Path, opts: list[str], exp: dict, + oname: str, ref: dict, oopts: dict, + tmp_path: pathlib.Path +) -> None: + expected = datatypes.Expected(**exp) + tdata = datatypes.TData( + ipath, [str(ipath)], opts, expected, + outname=oname, ref=ref, oo_opts=oopts + ) + run_main(tdata, tmp_path) diff --git a/tests/cli/test_template.py b/tests/cli/test_template.py index 146cebaa..47eafd01 100644 --- a/tests/cli/test_template.py +++ b/tests/cli/test_template.py @@ -1,34 +1,49 @@ # -# Copyright (C) 2013 - 2021 Satoru SATOH +# Copyright (C) 2013 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring -"""test cases of anyconfig.cli.main with template options. -""" -import unittest +# pylint: disable=missing-docstring, too-many-arguments +"""Test cases for anyconfig.cli.main with template option.""" +from __future__ import annotations -import anyconfig.template +import typing + +import pytest -from . import collectors, test_base +import anyconfig.template +from .. import common +from . import datatypes +from .common import run_main -class Collector(collectors.Collector): - kind = 'template' +if typing.TYPE_CHECKING: + import pathlib +if not anyconfig.template.SUPPORTED: + pytest.skip( + "Library for template rendering is not available", + allow_module_level=True + ) -@unittest.skipIf(not anyconfig.template.SUPPORTED, - 'Library for template rendering is not available') -class TestCase(test_base.BaseTestCase): - collector = Collector() +NAMES: list[str] = ("ipath", "opts", "exp", "oname", "ref") +DATA = common.load_data_for_testfile( + __file__, values=(("o", []), ("e", {}), ("on", ""), ("r", {})) +) +DATA_IDS: list[str] = common.get_test_ids(DATA) -class NoTemplateCollector(collectors.Collector): - kind = 'no_template' +def test_data(): + assert DATA -@unittest.skipIf(anyconfig.template.SUPPORTED, - 'Library for template rendering is available') -class SchemaErrorsTestCase(test_base.BaseTestCase): - collector = NoTemplateCollector() -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_cli( + ipath: pathlib.Path, opts: list[str], exp: dict, oname: str, ref: dict, + tmp_path: pathlib.Path +) -> None: + expected = datatypes.Expected(**exp) + tdata = datatypes.TData( + ipath, [str(ipath)], opts, expected, outname=oname, ref=ref + ) + run_main(tdata, tmp_path) diff --git a/tests/common/__init__.py b/tests/common/__init__.py index e69de29b..38ad93fc 100644 --- a/tests/common/__init__.py +++ b/tests/common/__init__.py @@ -0,0 +1,14 @@ +# +# Copyright (C) 2023, 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +"tests.common - common global variables and functions.""" +from .globals_ import TESTDIR, RESOURCE_DIR +from .tdc import ( + get_test_ids, load_data_for_testfile +) + +__all__ = [ + "TESTDIR", "RESOURCE_DIR", + "get_test_ids", "load_data_for_testfile", +] diff --git a/tests/common/paths.py b/tests/common/paths.py index 069cd5e3..e598aa2b 100644 --- a/tests/common/paths.py +++ b/tests/common/paths.py @@ -58,9 +58,9 @@ def get_data( def load_data( topdir: typing.Optional[pathlib.Path], - **kwargs + load_idata: bool = False, **kwargs ) -> list[tuple[pathlib.Path, dict[str, typing.Any]]]: - return [ + res = [ ( ipath, { @@ -70,3 +70,10 @@ def load_data( ) for ipath, adata in get_data(topdir) ] + if load_idata: + return [ + (ipath, load.load_data(ipath), adata) + for ipath, adata in res + ] + + return res diff --git a/tests/common/tdc.py b/tests/common/tdc.py new file mode 100644 index 00000000..715433b2 --- /dev/null +++ b/tests/common/tdc.py @@ -0,0 +1,81 @@ +# +# Copyright (C) 2023, 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring +r"""Test Data Collecor.""" +from __future__ import annotations + +import itertools +import os.path +import pathlib +import re +import typing + +from . import paths, globals_ + + +TEST_FILE_RE: re.Pattern = re.compile(r"test_(.+).py") + +VALUES: tuple[tuple[str, typing.Optional[dict], ...], ...] = ( + ("o", {}), ("e", None) +) + +LVL_DEFAULT: int = 3 + + +def get_test_id(path: pathlib.Path, level: int = LVL_DEFAULT) -> str: + return os.path.join(*path.parts[-level:]) + + +def get_test_ids( + data: list[tuple[pathlib.Path, typing.Any, ...]], + level: int = LVL_DEFAULT +) -> list[str]: + return [get_test_id(p, level=level) for p, *_ in data] + + +def get_test_resdir( + testfile: str, + topdir: pathlib.Path = globals_.TESTDIR, + resdir: pathlib.Path = globals_.RESOURCE_DIR, + pattern: re.Pattern = TEST_FILE_RE +) -> pathlib.Path: + """Get test resource dir for given test file path. + + ex. tests/api/single_load/test_query.py + -> /path/to/tests/res/1/api/single_load/query/ + """ + path = pathlib.Path(testfile).resolve() + subdir = pattern.match(path.name).groups()[0] + relpath = os.path.join( + *[x for x, y in itertools.zip_longest(path.parent.parts, topdir.parts) + if y is None] + ) + + return resdir / relpath / subdir + + +def load_data_for_testfile( + testfile: str, + values: tuple[tuple[str, typing.Optional[dict], ...], ...] = VALUES, + load_idata: bool = False, + **opts +) -> list[tuple[pathlib.Path, dict[str, typing.Any], ...]]: + """Collct test data for test file, ``testfile``. + + :param testfile: a str represents test file path + :param opts: keyword options for `get_test_resdir` + """ + datadir = get_test_resdir(testfile, **opts) + if load_idata: + return [ + (ipath, idata, *[aux.get(k, v) for k, v in values]) + for ipath, idata, aux + in paths.load_data(datadir, load_idata=True) + ] + + return [ + (ipath, *[aux.get(k, v) for k, v in values]) + for ipath, aux in paths.load_data(datadir) + ] diff --git a/tests/common/test_tdc.py b/tests/common/test_tdc.py new file mode 100644 index 00000000..202b404b --- /dev/null +++ b/tests/common/test_tdc.py @@ -0,0 +1,138 @@ +# +# Copyright (C) 2024 Satoru SATOH +# SPDX-License-Identifier: MIT +# +# pylint: disable=missing-docstring,too-few-public-methods +r"""Test cases for Test Data Collecor.""" +from __future__ import annotations + +import json +import pathlib + +import pytest + +from . import tdc as TT, globals_ as G + + +SELF = pathlib.Path(__file__) +CUDIR = SELF.parent + + +@pytest.mark.parametrize( + ("path", "level", "exp"), + (("a/b/c/d/e.py", TT.LVL_DEFAULT, "c/d/e.py"), + ("/a/b/c/d/e.py", TT.LVL_DEFAULT, "c/d/e.py"), + ("/a/b/c/d/e.py", 4, "b/c/d/e.py"), + ), +) +def test_get_test_id(path, level, exp) -> None: + exp = str(pathlib.Path(exp)) + assert TT.get_test_id(pathlib.Path(path), level=level) == exp + + +@pytest.mark.parametrize( + ("data", "level", "exp"), + (([], 1, []), + ([(pathlib.Path("a/b/c/d/e.py"), {}, None)], + TT.LVL_DEFAULT, ["c/d/e.py"]), + ), +) +def test_get_test_ids(data, level, exp) -> None: + exp = [str(pathlib.Path(e)) for e in exp] + assert TT.get_test_ids(data, level=level) == exp + + +TEST_FILE_10 = "foobar/baz/test_xyz.py" +TEST_TOP_DIR_10 = pathlib.Path("/home/foo/projects/bar/tests") +TEST_RES_DIR_10 = TEST_TOP_DIR_10 / "resources" +TEST_DATA_PATH_10 = TEST_RES_DIR_10 / "foobar" / "baz" / "xyz" + + +@pytest.mark.parametrize( + ("path", "opts", "exp"), + ((str(SELF), {}, G.RESOURCE_DIR / "common" / "tdc"), + (str(CUDIR / "test_paths.py"), {}, G.RESOURCE_DIR / "common" / "paths"), + (str(TEST_TOP_DIR_10 / TEST_FILE_10), + {"topdir": TEST_TOP_DIR_10, "resdir": TEST_RES_DIR_10}, + TEST_DATA_PATH_10), + ), + ids=(SELF.name, "test_paths.py", TEST_FILE_10), +) +def test_get_test_resdir(path, opts, exp): + assert TT.get_test_resdir(path, **opts) == exp + + +# .. note:: See files under tests/res/1/common/tdc/. +TEST_DATA_10 = [ + ("10/00.json", {}, {}), + ("20/10.json", [1, 2], {"a": "aaa"}), + ("30/20.json", {"a": "A"}, {"b": [1, 2], "c": {"baz": "fbz"}}), +] +TEST_DATA_20 = [ + ( + G.RESOURCE_DIR / "common" / "tdc" / "10" / "100_null.json", + None, + {"e": None} + ), + ( + G.RESOURCE_DIR / "common" / "tdc" / "20" / "220_a_list.json", + [1, 2], + {"e": [1, 2], "o": {"ac_ordered": True}} + ), +] + + +@pytest.mark.parametrize( + ("testfile", "kwargs", "exp"), + (pytest.param( + __file__, {}, + [(i, *[a.get(k, v) for k, v in TT.VALUES]) + for i, _, a in TEST_DATA_20], + id=f"{CUDIR.name}/{SELF.name} without loading data from ipath"), + pytest.param( + __file__, {"load_idata": True}, + [(i, d, *[a.get(k, v) for k, v in TT.VALUES]) + for i, d, a in TEST_DATA_20], + id=f"{CUDIR.name}/{SELF.name} with loading data from ipath"), + # ("foo/bar/test_baz.py", {"values": (("b", []), ("c", {}))}, + # TEST_DATA_10), + ), +) +def test_load_data_for_testfile( + testfile, kwargs, exp, tmp_path +): + if pathlib.Path(testfile).exists(): + assert TT.load_data_for_testfile(testfile, **kwargs) == exp + else: + testfile = tmp_path / testfile + testfile.parent.mkdir(parents=True, exist_ok=True) + testfile.touch() + + # kwargs for TT.get_test_resdir + kwargs.update(topdir=tmp_path, resdir=tmp_path) + resdir = tmp_path / TT.get_test_resdir(testfile, tmp_path, tmp_path) + + exp_new = [] + + for ipath, data, opts in exp: + path = resdir / ipath + path.parent.mkdir(parents=True, exist_ok=True) + json.dump(data, path.open("w")) + + opts_new = [] + for subdir, val in opts.items(): + if subdir not in kwargs.get("values", TT.VALUES): + continue + + (path.parent / subdir).mkdir(exist_ok=True) + + aname = path.name.replace(path.suffix, ".py") + (path.parent / subdir / aname).write_text(repr(val)) + opts_new.append({subdir: val}) + + if kwargs.get("load_idata", False): + exp_new.append((path, data, *opts_new)) + else: + exp_new.append((path, *opts_new)) + + assert TT.load_data_for_testfile(str(testfile), **kwargs) == exp_new diff --git a/tests/dicts/common.py b/tests/dicts/common.py deleted file mode 100644 index 5c51e16b..00000000 --- a/tests/dicts/common.py +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring -import unittest - -from .. import base - - -class Collector(base.TDataCollector): - ordered: bool = True - - -class TestCase(unittest.TestCase, Collector): - - def setUp(self): - self.init() - -# vim:sw=4:ts=4:et: diff --git a/tests/dicts/test_functions.py b/tests/dicts/test_functions.py index 27097cfa..f4330237 100644 --- a/tests/dicts/test_functions.py +++ b/tests/dicts/test_functions.py @@ -1,10 +1,11 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring,protected-access -"""Test cases for some functions in anyconfig.parser. -""" +"""Test cases for some functions in anyconfig.parser.""" +from __future__ import annotations + import collections import pytest diff --git a/tests/dicts/test_get.py b/tests/dicts/test_get.py index fb31e5bb..5e442029 100644 --- a/tests/dicts/test_get.py +++ b/tests/dicts/test_get.py @@ -1,28 +1,34 @@ # # Forked from m9dicts.tests.{api,dicts} # -# Copyright (C) 2011 - 2021 Satoru SATOH +# Copyright (C) 2011 - 2024 Satoru SATOH # # pylint: disable=missing-docstring,invalid-name +from __future__ import annotations + +import pytest + import anyconfig.dicts as TT -from .. import base -from . import common +from .. import common + +NAMES: list[str] = ("obj", "query", "exp", "emsg") +DATA_0: list[tuple] = common.load_data_for_testfile( + __file__, (("q", ""), ("e", None), ("s", "")), + load_idata=True +) +DATA: list[tuple] = [(d, *rest) for _, d, *rest in DATA_0] +DATA_IDS: list[str] = common.get_test_ids(DATA_0) -class TestCase(common.TestCase): - kind = 'get' - def test_get(self): - for data in self.each_data(): - emsg = base.load_data(data.scm) # diversion. - (res, err) = TT.get(data.inp, data.query) +def test_data(): + assert DATA - if emsg: - self.assertTrue(bool(err), data) - else: # emsg = '' - self.assertEqual(err, '', data) - self.assertEqual(res, data.exp, data) +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_get(obj, query, exp, emsg): + (res, err) = TT.get(obj, query) -# vim:sw=4:ts=4:et: + assert bool(err) if emsg else err == "" + assert res == exp diff --git a/tests/dicts/test_merge.py b/tests/dicts/test_merge.py index 6b11bb37..9ff1c42b 100644 --- a/tests/dicts/test_merge.py +++ b/tests/dicts/test_merge.py @@ -1,38 +1,45 @@ # # Forked from m9dicts.tests.{api,dicts} # -# Copyright (C) 2011 - 2021 Satoru SATOH +# Copyright (C) 2011 - 2024 Satoru SATOH # -# pylint: disable=missing-docstring,invalid-name +# pylint: disable=missing-docstring +from __future__ import annotations + +import pytest + import anyconfig.dicts as TT -from .. import base -from . import common +from .. import common + + +NAMES: list[str] = ("obj", "exp", "upd", "opts") +DATA_0: list[tuple] = common.load_data_for_testfile( + __file__, (("e", None), ("s", {}), ("o", {})), + load_idata=True +) +DATA: list[tuple] = [(d, *rest) for _, d, *rest in DATA_0] +DATA_IDS: list[str] = common.get_test_ids(DATA_0) + +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_merge(obj, exp, upd, opts): + TT.merge(obj, upd, **opts) + assert obj == exp -class TestCase(common.TestCase): - kind = 'merge' - def test_merge(self): - for data in self.each_data(): - upd = base.load_data(data.scm, ordered=True) # diversion. - TT.merge(data.inp, upd, **data.opts) - self.assertEqual(data.inp, data.exp, data) +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_merge_with_a_dict(obj, exp, upd, opts): + TT.merge(obj, upd, **opts) + assert obj == exp - def test_merge_with_a_dict(self): - for data in self.each_data(): - upd = base.load_data(data.scm) - TT.merge(data.inp, upd, **data.opts) - self.assertEqual(data.inp, data.exp, data) - def test_merge_with_an_iterable(self): - for data in self.each_data(): - upd = base.load_data(data.scm).items() - TT.merge(data.inp, upd, **data.opts) - self.assertEqual(data.inp, data.exp, data) +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_merge_with_an_iterable(obj, exp, upd, opts): + TT.merge(obj, upd.items(), **opts) + assert obj == exp - def test_merge_with_invalid_data(self): - with self.assertRaises((ValueError, TypeError)): - TT.merge(dict(a=1), 1) -# vim:sw=4:ts=4:et: +def test_merge_with_invalid_data(): + with pytest.raises((ValueError, TypeError)): + TT.merge({"a": 1}, 1) diff --git a/tests/dicts/test_mk_nested_dic.py b/tests/dicts/test_mk_nested_dic.py index 0a6e75a7..201f0439 100644 --- a/tests/dicts/test_mk_nested_dic.py +++ b/tests/dicts/test_mk_nested_dic.py @@ -1,25 +1,27 @@ # # Forked from m9dicts.tests.{api,dicts} # -# Copyright (C) 2011 - 2021 Satoru SATOH +# Copyright (C) 2011 - 2024 Satoru SATOH # -# pylint: disable=missing-docstring,invalid-name +# pylint: disable=missing-docstring +from __future__ import annotations + +import pytest + import anyconfig.dicts as TT -from . import common +from .. import common -class TestCase(common.TestCase): - kind = 'mk_nested_dic' - pattern = '*.*' - ordered = False +NAMES: list[str] = ("obj", "val", "exp", "opts") +DATA_0: list[tuple] = common.load_data_for_testfile( + __file__, (("q", ""), ("e", None), ("o", {})), + load_idata=True +) +DATA: list[tuple] = [(d, *rest) for _, d, *rest in DATA_0] +DATA_IDS: list[str] = common.get_test_ids(DATA_0) - def test_mk_nested_dic(self): - for data in self.each_data(): - val = data.query # diversion. - self.assertEqual( - TT.mk_nested_dic(data.inp, val, **data.opts), - data.exp - ) -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_mk_nested_dic(obj, val, exp, opts): + assert TT.mk_nested_dic(obj, val, **opts) == exp diff --git a/tests/ioinfo/constants.py b/tests/ioinfo/constants.py index cc3c0c8e..724f7bd6 100644 --- a/tests/ioinfo/constants.py +++ b/tests/ioinfo/constants.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring @@ -7,5 +7,3 @@ TEST_PY = pathlib.Path(__file__).resolve() - -# vim:sw=4:ts=4:et: diff --git a/tests/ioinfo/test_detectors.py b/tests/ioinfo/test_detectors.py index 187a70d0..8ee2b586 100644 --- a/tests/ioinfo/test_detectors.py +++ b/tests/ioinfo/test_detectors.py @@ -2,92 +2,76 @@ # Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring,consider-using-with -r"""test cases for anyconfig.ioinfo.detectors. -""" +# pylint: disable=missing-docstring +r"""test cases for anyconfig.ioinfo.detectors.""" from __future__ import annotations import pathlib -import unittest -import typing + +import pytest import anyconfig.ioinfo import anyconfig.ioinfo.detectors as TT -if typing.TYPE_CHECKING: - import collections.abc - - -class TestCase(unittest.TestCase): - - def _run( - self, target_fn: collections.abc.Callable[..., typing.Any], - ies: collections.abc.Iterable[tuple[typing.Any, bool]] - ) -> None: - for inp, exp in ies: - meth = self.assertTrue if exp else self.assertFalse - meth(target_fn(inp), f'input: {inp!r}, expected: {exp!r}') - - def test_is_path_str(self): - self._run( - TT.is_path_str, - ((None, False), - ('/tmp/t.xt', True), - (0, False), - (pathlib.Path(__file__), False), - (open(__file__), False), - (anyconfig.ioinfo.make(__file__), False), - ) - ) - - def test_is_path_obj(self): - self._run( - TT.is_path_obj, - ((None, False), - (__file__, False), - (pathlib.Path(__file__), True), - (str(pathlib.Path(__file__).resolve()), False), - (open(__file__), False), - (anyconfig.ioinfo.make(__file__), False), - ) - ) - def test_is_io_stream(self): - self._run( - TT.is_io_stream, - ((None, False), - (__file__, False), - (pathlib.Path(__file__), False), - (str(pathlib.Path(__file__).resolve()), False), - (open(__file__), True), - (anyconfig.ioinfo.make(__file__), False), - ) - ) +PATH_STR_10 = __file__ +PATH_OBJ_10 = pathlib.Path(PATH_STR_10) +FILE_OBJ_10 = open(__file__, encoding="utf-8") +IOI_OBJ_10 = anyconfig.ioinfo.make(__file__) - def test_is_ioinfo(self): - self._run( - TT.is_ioinfo, - ((None, False), - (__file__, False), - (pathlib.Path(__file__), False), - (str(pathlib.Path(__file__).resolve()), False), - (open(__file__), False), - (anyconfig.ioinfo.make(__file__), True), - (anyconfig.ioinfo.make(open(__file__)), True), - ) - ) +PATH_OBJ_20 = PATH_OBJ_10.resolve() +PATH_STR_20 = str(PATH_OBJ_20) +IOI_OBJ_20 = anyconfig.ioinfo.make(FILE_OBJ_10) - def test_is_stream(self): - self._run( - TT.is_stream, - ((None, False), - (__file__, False), - (pathlib.Path(__file__), False), - (str(pathlib.Path(__file__).resolve()), False), - (open(__file__), False), - (anyconfig.ioinfo.make(__file__), False), - (anyconfig.ioinfo.make(open(__file__)), True), - ) - ) -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize( + ("target_fn", "obj", "exp"), + ((TT.is_path_str, None, False), + (TT.is_path_str, 0, False), + (TT.is_path_str, PATH_OBJ_10, False), + (TT.is_path_str, PATH_OBJ_20, False), + (TT.is_path_str, FILE_OBJ_10, False), + (TT.is_path_str, IOI_OBJ_10, False), + (TT.is_path_str, IOI_OBJ_20, False), + (TT.is_path_str, PATH_STR_10, True), + (TT.is_path_str, PATH_STR_20, True), + (TT.is_path_obj, None, False), + (TT.is_path_obj, 0, False), + (TT.is_path_obj, PATH_STR_10, False), + (TT.is_path_obj, PATH_STR_20, False), + (TT.is_path_obj, FILE_OBJ_10, False), + (TT.is_path_obj, IOI_OBJ_10, False), + (TT.is_path_obj, IOI_OBJ_20, False), + (TT.is_path_obj, PATH_OBJ_10, True), + (TT.is_path_obj, PATH_OBJ_20, True), + (TT.is_io_stream, None, False), + (TT.is_io_stream, 0, False), + (TT.is_io_stream, PATH_STR_10, False), + (TT.is_io_stream, PATH_STR_20, False), + (TT.is_io_stream, PATH_OBJ_10, False), + (TT.is_io_stream, PATH_OBJ_20, False), + (TT.is_io_stream, IOI_OBJ_10, False), + (TT.is_io_stream, IOI_OBJ_20, False), + (TT.is_io_stream, FILE_OBJ_10, True), + (TT.is_ioinfo, None, False), + (TT.is_ioinfo, 0, False), + (TT.is_ioinfo, PATH_STR_10, False), + (TT.is_ioinfo, PATH_STR_20, False), + (TT.is_ioinfo, PATH_OBJ_10, False), + (TT.is_ioinfo, PATH_OBJ_20, False), + (TT.is_ioinfo, FILE_OBJ_10, False), + (TT.is_ioinfo, IOI_OBJ_10, True), + (TT.is_ioinfo, IOI_OBJ_20, True), + (TT.is_stream, None, False), + (TT.is_stream, 0, False), + (TT.is_stream, PATH_STR_10, False), + (TT.is_stream, PATH_STR_20, False), + (TT.is_stream, PATH_OBJ_10, False), + (TT.is_stream, PATH_OBJ_20, False), + (TT.is_stream, FILE_OBJ_10, False), + (TT.is_stream, IOI_OBJ_10, False), + (TT.is_stream, IOI_OBJ_20, True), + ), +) +def test_is_path_str(target_fn, obj, exp): + assert (target_fn(obj) == exp if exp else not target_fn(obj)) diff --git a/tests/ioinfo/test_factory.py b/tests/ioinfo/test_factory.py index 44d7e4da..e4562ffc 100644 --- a/tests/ioinfo/test_factory.py +++ b/tests/ioinfo/test_factory.py @@ -1,11 +1,12 @@ # -# Copyright (C) 2018 - 2021 Satoru SATOH +# Copyright (C) 2018 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring, invalid-name -"""Test cases for anyconfig.ioinfo.factory. -""" -import unittest +# pylint: disable=missing-docstring +"""Test cases for anyconfig.ioinfo.factory.""" +from __future__ import annotations + +import pytest import anyconfig.ioinfo.factory as TT @@ -24,21 +25,23 @@ ) -class TestCase(unittest.TestCase): - - def test_make(self): - ies = ( - (TEST_IOI_PATH_OBJ, TEST_IOI_PATH_OBJ), - (TEST_IOI_STREAM, TEST_IOI_STREAM), - (str(TEST_PY), TEST_IOI_PATH_OBJ), - ) - for inp, exp in ies: - self.assertEqual(TT.make(inp), exp) +@pytest.mark.parametrize( + ("obj", "exp"), + (pytest.param(TEST_IOI_PATH_OBJ, TEST_IOI_PATH_OBJ, id="pathlib.Path"), + pytest.param(TEST_IOI_STREAM, TEST_IOI_STREAM, id="IO stream"), + pytest.param(str(TEST_PY), TEST_IOI_PATH_OBJ, id="path (str)"), + ), +) +def test_make(obj, exp): + assert TT.make(obj) == exp - def test_make_failures(self): - inps = (None, ) - for inp in inps: - with self.assertRaises(ValueError): - TT.make(inp) -# vim:sw=4:ts=4:et: +@pytest.mark.filterwarnings("ignore") +@pytest.mark.parametrize( + ("obj", ), + ((None, ), + ), +) +def test_make_failiures(obj): + with pytest.raises(ValueError): + TT.make(obj) diff --git a/tests/ioinfo/test_utils.py b/tests/ioinfo/test_utils.py index 4ed24f00..53b3f0ff 100644 --- a/tests/ioinfo/test_utils.py +++ b/tests/ioinfo/test_utils.py @@ -1,10 +1,11 @@ # -# Copyright (C) 2012 - 2021 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -r"""Test cases for anyconfig.utils.files. -""" +r"""Test cases for anyconfig.utils.files.""" +from __future__ import annotations + import pathlib import pytest @@ -16,12 +17,12 @@ @pytest.mark.parametrize( - ("inp", "exp"), + ("obj", "exp"), ((SELF, (SELF.resolve(), "py")), ) ) -def test_get_path_and_ext(inp, exp): - res = TT.get_path_and_ext(inp) +def test_get_path_and_ext(obj, exp): + res = TT.get_path_and_ext(obj) assert res == exp @@ -53,7 +54,7 @@ def test_expand_from_path(tmp_path): path = tdir / "d.txt" - for inp, exp in ((path, [path]), + for obj, exp in ((path, [path]), (tdir / "*.txt", [tdir / "d.txt", tdir / "e.txt"]), (tdir.parent / "**" / "*.txt", @@ -63,7 +64,5 @@ def test_expand_from_path(tmp_path): tdir / "e.txt", tdir / "f.json"]), ): - res = sorted(TT.expand_from_path(inp)) - assert res == sorted(exp), f"{inp!r} vs. {exp!r}" - -# vim:sw=4:ts=4:et: + res = sorted(TT.expand_from_path(obj)) + assert res == sorted(exp), f"{obj!r} vs. {exp!r}" diff --git a/tests/parser/common.py b/tests/parser/common.py deleted file mode 100644 index 01199f51..00000000 --- a/tests/parser/common.py +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (C) 2021 Satoru SATOH -# SPDX-License-Identifier: MIT -# -# pylint: disable=missing-docstring -import unittest - -from .. import base - - -class Collector(base.TDataCollector): - pass - - -class TestCase(unittest.TestCase, Collector): - - def setUp(self): - self.init() - -# vim:sw=4:ts=4:et: diff --git a/tests/parser/test_attrlist.py b/tests/parser/test_attrlist.py index 9b01d28a..4632ec5f 100644 --- a/tests/parser/test_attrlist.py +++ b/tests/parser/test_attrlist.py @@ -1,25 +1,31 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -"""Test cases for anyconfig.parser.parse_attrlist. -""" +"""Test cases for anyconfig.parser.parse_attrlist.""" +from __future__ import annotations + +import pytest + import anyconfig.parser as TT -from . import common +from .. import common + + +NAMES: list[str] = ("obj", "exp", "opts") +DATA_0: list[tuple] = common.load_data_for_testfile( + __file__, (("e", None), ("o", {})), + load_idata=True +) +DATA: list[tuple] = [(d, *rest) for _, d, *rest in DATA_0] +DATA_IDS: list[str] = common.get_test_ids(DATA_0) -class TestCase(common.TestCase): - kind = 'attrlist' - pattern = '*.txt' +def test_data(): + assert DATA - def test_parse_attrlist(self): - for data in self.each_data(): - self.assertEqual( - TT.parse_attrlist(data.inp, **data.opts), - data.exp, - data - ) -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_parse_attrlist(obj, exp, opts) -> None: + assert TT.parse_attrlist(obj, **opts) == exp diff --git a/tests/parser/test_attrlist_0.py b/tests/parser/test_attrlist_0.py index 86d52bc7..4f49e45b 100644 --- a/tests/parser/test_attrlist_0.py +++ b/tests/parser/test_attrlist_0.py @@ -1,25 +1,31 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -"""Test cases for anyconfig.parser.parse_attrlist_0. -""" +"""Test cases for anyconfig.parser.parse_attrlist_0.""" +from __future__ import annotations + +import pytest + import anyconfig.parser as TT -from . import common +from .. import common + + +NAMES: list[str] = ("obj", "exp", "opts") +DATA_0: list[tuple] = common.load_data_for_testfile( + __file__, (("e", None), ("o", {})), + load_idata=True +) +DATA: list[tuple] = [(d, *rest) for _, d, *rest in DATA_0] +DATA_IDS: list[str] = common.get_test_ids(DATA_0) -class TestCase(common.TestCase): - kind = 'attrlist_0' - pattern = '*.txt' +def test_data(): + assert DATA - def test_parse_attrlist_0(self): - for data in self.each_data(): - self.assertEqual( - TT.parse_attrlist_0(data.inp, **data.opts), - data.exp, - data - ) -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_parse_attrlist_0(obj, exp, opts) -> None: + assert TT.parse_attrlist_0(obj, **opts) == exp diff --git a/tests/parser/test_list.py b/tests/parser/test_list.py index a9313dce..e0489fa9 100644 --- a/tests/parser/test_list.py +++ b/tests/parser/test_list.py @@ -1,25 +1,31 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -"""Test cases for anyconfig.parser.parse_list. -""" +"""Test cases for anyconfig.parser.parse_list.""" +from __future__ import annotations + +import pytest + import anyconfig.parser as TT -from . import common +from .. import common + + +NAMES: list[str] = ("obj", "exp", "opts") +DATA_0: list[tuple] = common.load_data_for_testfile( + __file__, (("e", None), ("o", {})), + load_idata=True +) +DATA: list[tuple] = [(d, *rest) for _, d, *rest in DATA_0] +DATA_IDS: list[str] = common.get_test_ids(DATA_0) -class TestCase(common.TestCase): - kind = 'list' - pattern = '*.*' +def test_data(): + assert DATA - def test_parse_list(self): - for data in self.each_data(): - self.assertEqual( - TT.parse_list(data.inp, **data.opts), - data.exp, - data - ) -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_parse_list(obj, exp, opts) -> None: + assert TT.parse_list(obj, **opts) == exp diff --git a/tests/parser/test_parse.py b/tests/parser/test_parse.py index ca7b2184..3266b597 100644 --- a/tests/parser/test_parse.py +++ b/tests/parser/test_parse.py @@ -1,25 +1,31 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -"""Test cases for anyconfig.parser.parse. -""" +"""Test cases for anyconfig.parser.parse.""" +from __future__ import annotations + +import pytest + import anyconfig.parser as TT -from . import common +from .. import common + + +NAMES: list[str] = ("obj", "exp", "opts") +DATA_0: list[tuple] = common.load_data_for_testfile( + __file__, (("e", None), ("o", {})), + load_idata=True +) +DATA: list[tuple] = [(d, *rest) for _, d, *rest in DATA_0] +DATA_IDS: list[str] = common.get_test_ids(DATA_0) -class TestCase(common.TestCase): - kind = 'parse' - pattern = '*.*' +def test_data(): + assert DATA - def test_parse(self): - for data in self.each_data(): - self.assertEqual( - TT.parse(data.inp, **data.opts), - data.exp, - data - ) -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_parse(obj, exp, opts) -> None: + assert TT.parse(obj, **opts) == exp diff --git a/tests/parser/test_single.py b/tests/parser/test_single.py index e5367dee..853179cc 100644 --- a/tests/parser/test_single.py +++ b/tests/parser/test_single.py @@ -1,21 +1,30 @@ # -# Copyright (C) 2021 Satoru SATOH +# Copyright (C) 2021 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -"""Test cases for anyconfig.parser.parse_single. -""" +"""Test cases for anyconfig.parser.parse_single.""" +from __future__ import annotations + +import pytest + import anyconfig.parser as TT -from . import common +from .. import common + + +NAMES: list[str] = ("obj", "exp") +DATA_0: list[tuple] = common.load_data_for_testfile( + __file__, (("e", None), ), load_idata=True +) +DATA: list[tuple] = [(d, *rest) for _, d, *rest in DATA_0] +DATA_IDS: list[str] = common.get_test_ids(DATA_0) -class TestCase(common.TestCase): - kind = 'single' - pattern = '*.*' +def test_data(): + assert DATA - def test_parse_single(self): - for data in self.each_data(): - self.assertEqual(TT.parse_single(data.inp), data.exp) -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize(NAMES, DATA, ids=DATA_IDS) +def test_parse_single(obj, exp) -> None: + assert TT.parse_single(obj) == exp diff --git a/tests/parsers/test_parsers.py b/tests/parsers/test_parsers.py index cd85fcb9..6d32a30c 100644 --- a/tests/parsers/test_parsers.py +++ b/tests/parsers/test_parsers.py @@ -1,14 +1,17 @@ # -# Copyright (C) 2012 - 2024 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring, invalid-name +# pylint: disable=missing-docstring +"Test cases for anyconfig.parsers.""" +from __future__ import annotations import pathlib -import unittest + +import pytest import anyconfig.backend.json -import anyconfig.backend.json.stdlib as JSON +import anyconfig.backend.json.stdlib as JSONStdlib try: import anyconfig.backend.yaml.pyyaml as PYYAML except ImportError: @@ -21,50 +24,59 @@ UnknownProcessorTypeError, UnknownFileTypeError ) -from .. import base +from ..common import RESOURCE_DIR + + +CNF_PATH: pathlib.Path = ( + RESOURCE_DIR / "loaders/json.stdlib/10/360_a_nested_map.json" +) + +@pytest.fixture(name="parsers") +def found_parsers(): + return TT.Parsers() -CNF_PATH = base.RES_DIR / 'base/basics/10/10.json' +def test_json_parsers(parsers): + psrs = parsers.findall(None, forced_type="json") + assert psrs + assert JSONStdlib.Parser in psrs + assert psrs[0] == JSONStdlib.Parser -class Test(unittest.TestCase): - def setUp(self): - self.psrs = TT.Parsers() +@pytest.mark.skipif(PYYAML is None, reason="PyYAML is not available.") +def test_yaml_parsers(parsers): + psrs = parsers.findall(None, forced_type="yaml") + assert psrs + assert PYYAML.Parser in psrs + assert psrs[0] == PYYAML.Parser - def test_10_json_parsers(self): - jpsrs = self.psrs.findall(None, forced_type="json") - self.assertTrue(isinstance(jpsrs[0], JSON.Parser)) - def test_12_yaml_parsers(self): - if PYYAML: - ypsrs = self.psrs.findall(None, forced_type="yaml") - self.assertTrue(isinstance(ypsrs[0], PYYAML.Parser)) +@pytest.mark.parametrize( + ("exc", "arg0", "kwargs"), + ((ValueError, None, {}), + (UnknownProcessorTypeError, None, {"forced_type": "_unkonw_type_"}), + (UnknownFileTypeError, "cnf.unknown_ext", {}), + ), +) +def test_find__failures(exc, arg0, kwargs, parsers): + with pytest.raises(exc): + parsers.find(arg0, **kwargs) - def test_30_find__ng_cases(self): - self.assertRaises(ValueError, self.psrs.find, None) - self.assertRaises(UnknownProcessorTypeError, self.psrs.find, None, - forced_type="_unkonw_type_") - self.assertRaises(UnknownFileTypeError, self.psrs.find, - "cnf.unknown_ext") - def test_32_find__ng_cases(self): - pcls = anyconfig.backend.json.Parser - self.assertTrue(isinstance(self.psrs.find("x.conf", - forced_type="json"), - pcls)) - self.assertTrue(isinstance(self.psrs.find("x.json"), pcls)) +def test_find(parsers): + pcls = anyconfig.backend.json.Parser + assert isinstance(parsers.find("x.conf", forced_type="json"), pcls) + assert isinstance(parsers.find("x.json"), pcls) - with open(CNF_PATH) as inp: - self.assertTrue(isinstance(self.psrs.find(inp), pcls)) + with open(CNF_PATH, encoding="utf-8") as inp: + assert isinstance(parsers.find(inp), pcls) - if pathlib is not None: - inp = pathlib.Path("x.json") - self.assertTrue(isinstance(self.psrs.find(inp), pcls)) + inp = pathlib.Path("x.json") + assert isinstance(parsers.find(inp), pcls) - def test_34_find__input_object(self): - inp = anyconfig.ioinfo.make(CNF_PATH) - psr = self.psrs.find(inp) - self.assertTrue(isinstance(psr, anyconfig.backend.json.Parser)) -# vim:sw=4:ts=4:et: +def test_find__input_object(parsers): + inp = anyconfig.ioinfo.make(CNF_PATH) + psr = parsers.find(inp) + assert isinstance(psr, anyconfig.backend.json.Parser) diff --git a/tests/parsers/test_utils.py b/tests/parsers/test_utils.py index a494cfa6..e80c8dee 100644 --- a/tests/parsers/test_utils.py +++ b/tests/parsers/test_utils.py @@ -1,71 +1,82 @@ # -# Copyright (C) 2012 - 2021 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring, invalid-name +# pylint: disable=missing-docstring +"Test cases for anyconfig.parsers.utils.""" +from __future__ import annotations + import operator -import unittest +import pytest + +import anyconfig.parsers.parsers import anyconfig.parsers.utils as TT from anyconfig.common import ( UnknownFileTypeError, UnknownProcessorTypeError ) from anyconfig.backend.json import PARSERS as JSON_PSR_CLSS -from anyconfig.parsers.parsers import Parsers -PSRS = Parsers().list() +PSRS = anyconfig.parsers.parsers.Parsers().list() JSON_PSRS = sorted( (p() for p in JSON_PSR_CLSS), key=operator.methodcaller("priority"), reverse=True ) -class TestCase(unittest.TestCase): - - def test_load_plugins(self): - TT.load_plugins() - self.assertTrue(PSRS) - - def test_list_types(self): - res = TT.list_types() - self.assertTrue(bool(res)) - self.assertTrue(any(x in res for x in ("json", "ini", "xml"))) - - def test_list_by_x(self): - for lfn in (TT.list_by_cid, TT.list_by_type, TT.list_by_extension): - psrs = lfn() - self.assertTrue(bool(psrs)) - - def test_findall_ng_cases(self): - ies = (((None, None), ValueError), # w/o path nor type - (("/tmp/x.xyz", None), UnknownFileTypeError), - (("/dev/null", None), UnknownFileTypeError), - ((None, "xyz"), UnknownProcessorTypeError), - ) - for inp, exc in ies: - with self.assertRaises(exc): - TT.findall(*inp) - - def test_findall(self): - argss = (("foo.json", None), - (None, "json"), - ) - for args in argss: - psrs = TT.findall(*args) - - self.assertTrue(bool(psrs)) - self.assertEqual(psrs, JSON_PSRS) - - def test_find(self): - argss = (("foo.json", None), - (None, "json"), - (None, JSON_PSR_CLSS[0]), - (None, JSON_PSRS[0]), - ) - for args in argss: - psr = TT.find(*args) - self.assertEqual(psr, JSON_PSRS[0]) - -# vim:sw=4:ts=4:et: +def test_load_plugins(): + TT.load_plugins() + assert PSRS + + +def test_list_types(): + res = TT.list_types() + assert bool(res) + assert any(x in res for x in ("json", "ini", "xml")) + + +def test_list_by_x(): + for lfn in (TT.list_by_cid, TT.list_by_type, TT.list_by_extension): + psrs = lfn() + assert bool(psrs) + + +@pytest.mark.parametrize( + ("args", "exc"), + (((None, None), ValueError), # w/o path nor type + (("/tmp/x.xyz", None), UnknownFileTypeError), + (("/dev/null", None), UnknownFileTypeError), + ((None, "xyz"), UnknownProcessorTypeError), + ) +) +def test_findall_ng_cases(args, exc): + with pytest.raises(exc): + TT.findall(*args) + + +@pytest.mark.parametrize( + ("obj", "typ"), + (("foo.json", None), + (None, "json"), + ) +) +def test_findall(obj, typ): + psrs = TT.findall(obj=obj, forced_type=typ) + + assert bool(psrs) + assert psrs == JSON_PSRS + + +@pytest.mark.parametrize( + ("obj", "typ"), + (("foo.json", None), + (None, "json"), + (None, JSON_PSR_CLSS[0]), + (None, JSON_PSRS[0]), + ) +) +def test_find(obj, typ): + psr = TT.find(obj=obj, forced_type=typ) + assert psr == JSON_PSRS[0] diff --git a/tests/processors/test_processors.py b/tests/processors/test_processors.py index 5cf4e67a..b29df125 100644 --- a/tests/processors/test_processors.py +++ b/tests/processors/test_processors.py @@ -1,51 +1,53 @@ # -# Copyright (C) 2018 - 2021 Satoru SATOH +# Copyright (C) 2018 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring, invalid-name +# pylint: disable=missing-docstring import operator -import unittest + +import pytest import anyconfig.processors.processors as TT from .common import A, A2, B, C, PRS -class Test_10_Processor(unittest.TestCase): +def test_processort_compare() -> None: + (a1, a2, a22, b) = (A(), A(), A2(), B()) + assert a1 == a2 + assert a1 != b + assert a1 != a22 + - def test_10_eq(self): - (a1, a2, a22, b) = (A(), A(), A2(), B()) - self.assertEqual(a1, a2) - self.assertNotEqual(a1, b) - self.assertNotEqual(a1, a22) +def test_processor_init(): + prcs = TT.Processors() + assert not prcs.list() -class Test_40_Processors(unittest.TestCase): +def test_processor_init_with_processors(): + prcs = TT.Processors(PRS) + assert prcs.list(sort=True) == sorted( + PRS, + key=operator.methodcaller("cid") + ) - def test_10_init(self): - prcs = TT.Processors() - self.assertFalse(prcs.list()) - def test_12_init_with_processors(self): - prcs = TT.Processors(PRS) - self.assertEqual(prcs.list(sort=True), - sorted(PRS, key=operator.methodcaller("cid"))) +def test_processor_list_by_cid(): + prcs = TT.Processors(PRS) + exp = sorted( + ((p.cid(), [p]) for p in PRS), + key=TT.operator.itemgetter(0) + ) + assert prcs.list_by_cid() == exp - def test_20_list_by_cid(self): - prcs = TT.Processors(PRS) - exp = sorted(((p.cid(), [p]) for p in PRS), - key=TT.operator.itemgetter(0)) - self.assertEqual(prcs.list_by_cid(), exp) - def test_20_list_x(self): - prcs = TT.Processors(PRS) - self.assertRaises(ValueError, prcs.list_x) - self.assertEqual(prcs.list_x("cid"), - sorted(set(p.cid() for p in PRS))) - self.assertEqual(prcs.list_x("type"), - sorted(set(p.type() for p in PRS))) +def test_processor_list_x(): + prcs = TT.Processors(PRS) + with pytest.raises(ValueError): + prcs.list_x() - res = sorted(set(A.extensions() + B.extensions() + C.extensions())) - self.assertEqual(prcs.list_x("extension"), res) + assert prcs.list_x("cid") == sorted(set(p.cid() for p in PRS)) + assert prcs.list_x("type") == sorted(set(p.type() for p in PRS)) -# vim:sw=4:ts=4:et: + res = sorted(set(A.extensions() + B.extensions() + C.extensions())) + assert prcs.list_x("extension") == res diff --git a/tests/processors/test_utils.py b/tests/processors/test_utils.py index 9c2257dc..8b0fa6e9 100644 --- a/tests/processors/test_utils.py +++ b/tests/processors/test_utils.py @@ -1,9 +1,14 @@ # -# Copyright (C) 2018 - 2021 Satoru SATOH +# Copyright (C) 2018 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring, invalid-name -import unittest +# pylint: disable=missing-docstring +"""Test cases for anyconfig.processors.utils.""" +from __future__ import annotations + +import typing + +import pytest import anyconfig.ioinfo import anyconfig.processors.utils as TT @@ -13,210 +18,240 @@ ) from .common import A, A2, A3, B, C, PRS +if typing.TYPE_CHECKING: + import collections.abc + PRS = [p() for p in PRS] # Instantiate all. -class TestCase(unittest.TestCase): - - def test_select_by_key(self): - ies = (([], []), - (((["a"], 1), ), [("a", [1])]), - (((["a", "aaa"], 1), - (["b", "bb"], 2), - (["a"], 3)), - [("a", [1, 3]), - ("aaa", [1]), - ("b", [2]), - ("bb", [2])])) - - for inp, exp in ies: - self.assertEqual(TT.select_by_key(inp), exp) - - def test_select_by_key_reversed(self): - ies = ((((["a", "aaa"], 1), - (["a"], 3)), - [("a", [3, 1]), - ("aaa", [1])]), - ) - - def sfn(itr): - return sorted(itr, reverse=True) - - for inp, exp in ies: - self.assertEqual(TT.select_by_key(inp, sfn), exp) - - def test_list_by_x(self): - (a, a2, a3, b, c) = (A(), A2(), A3(), B(), C()) - ies = ((([], "type"), []), - (([a], "type"), [(a.type(), [a])]), - (([a], "extensions"), - [(x, [a]) for x in a.extensions()]), - (((a, a2, a3), "type"), - [(a.type(), [a3, a2, a])]), - (([a, b, c], "type"), - [(a.type(), [a]), (b.type(), [b, c])]), - ((PRS, "type"), - [(a.type(), [a3, a2, a]), (b.type(), [b, c])]), - ((PRS, "extensions"), - [("js", [a3, a2, a]), ("json", [a3, a2, a]), - ("jsn", [a3, a2, a]), ("yaml", [b, c]), ("yml", [b, c])]), - ) - - for prs_key, exp in ies: - self.assertEqual( - sorted(TT.list_by_x(*prs_key)), sorted(exp) - ) - - def test_list_by_x_ng_cases(self): - with self.assertRaises(ValueError): - TT.list_by_x(PRS, "undef") - - def test_findall_with_pred__type(self): - def _findall_by_type(typ): - return TT.findall_with_pred(lambda p: p.type() == typ, PRS) - - (a, a2, a3, b, c) = (A(), A2(), A3(), B(), C()) - ies = (("json", [a3, a2, a]), - ("yaml", [b, c]), - ("undefined", []), - ) - - for inp, exp in ies: - self.assertEqual(_findall_by_type(inp), exp) - - def test_findall_with_pred__ext(self): - def _findall_with_pred__ext(ext): - return TT.findall_with_pred(lambda p: ext in p.extensions(), PRS) - - (a, a2, a3, b, c) = (A(), A2(), A3(), B(), C()) - ies = (("js", [a3, a2, a]), - ("yml", [b, c]), - ("xyz", []), - ) - - for inp, exp in ies: - self.assertEqual(_findall_with_pred__ext(inp), exp) - - def assertInstance(self, obj, cls): - self.assertTrue(isinstance(obj, cls)) - - def test_maybe_processor(self): - a3 = A3() - ies = (((a3, A3), True), - ((A3, A3), True), - ((B, A3), False), - ) - for inp, exp in ies: - afn = self.assertTrue if exp else self.assertFalse - res = TT.maybe_processor(*inp) - afn(isinstance(res, A3)) - - if not exp: - self.assertTrue(res is None) - - def test_find_by_type_or_id(self): - (a, a2, a3, b, c) = (A(), A2(), A3(), B(), C()) - ies = ((("json", PRS), [a3, a2, a]), - (("yaml", PRS), [b, c]), - (("dummy", PRS), [c]), - ) - for inp, exp in ies: - self.assertEqual(TT.find_by_type_or_id(*inp), exp) - - def test_find_by_type_or_id_ng_cases(self): - with self.assertRaises(UnknownProcessorTypeError): - TT.find_by_type_or_id("xyz", PRS) - - def test_find_by_fileext(self): - ies = ((("js", PRS), [A3(), A2(), A()]), - (("yml", PRS), [B(), C()]), - ) - for inp, exp in ies: - self.assertEqual(TT.find_by_fileext(*inp), exp) - - def test_find_by_fileext_ng_cases(self): - with self.assertRaises(UnknownFileTypeError): - TT.find_by_fileext("xyz", PRS) - - def test_find_by_maybe_file(self): - (a, a2, a3, b, c) = (A(), A2(), A3(), B(), C()) - obj = anyconfig.ioinfo.make("/path/to/a.json") - - ies = ((("/path/to/a.jsn", PRS), [a3, a2, a]), - (("../../path/to/b.yml", PRS), [b, c]), - ((obj, PRS), [a3, a2, a]), - ) - - for inp, exp in ies: - self.assertEqual(TT.find_by_maybe_file(*inp), exp) - - def test_find_by_maybe_file_ng_cases(self): - ies = (("/tmp/x.xyz", PRS), - ("/dev/null", PRS), - ) - for inp in ies: - with self.assertRaises(UnknownFileTypeError): - TT.find_by_maybe_file(*inp) - - def test_findall_ng_cases(self): - ies = (((None, PRS, None), ValueError), # w/o path nor type - (("/tmp/x.xyz", PRS, None), UnknownFileTypeError), - (("/dev/null", PRS, None), UnknownFileTypeError), - ((None, PRS, "xyz"), UnknownProcessorTypeError), - ) - for inp, exc in ies: - with self.assertRaises(exc): - TT.findall(*inp) - - def test_findall_by_maybe_file(self): - (a, a2, a3, b, c) = (A(), A2(), A3(), B(), C()) - obj = anyconfig.ioinfo.make("/path/to/a.json") - - ies = ((("/path/to/a.jsn", PRS), [a3, a2, a]), - (("../../path/to/b.yml", PRS), [b, c]), - ((obj, PRS), [a3, a2, a]), - ) - for inp, exp in ies: - self.assertEqual(TT.findall(*inp), exp) - - def test_findall_by_type_or_id(self): - (a, a2, a3, b, c) = (A(), A2(), A3(), B(), C()) - ies = (((None, PRS, "json"), [a3, a2, a]), - ((None, PRS, "yaml"), [b, c]), - ((None, PRS, "dummy"), [c]), - ) - for inp, exp in ies: - self.assertEqual(TT.findall(*inp), exp) - - def test_find_by_forced_type(self): - a2 = A2() - c = C() - ies = (((None, PRS, A2), a2), - ((None, PRS, A2), a2), - ((None, PRS, c.cid()), c), - ) - - for inp, exp in ies: - self.assertEqual(TT.find(*inp), exp) - - def test_find__maybe_file(self): - (a3, b) = (A3(), B()) - obj = anyconfig.ioinfo.make("/path/to/a.json") - - ies = ((("/path/to/a.jsn", PRS), a3), - (("../../path/to/b.yml", PRS), b), - ((obj, PRS), a3), - ) - for inp, exp in ies: - self.assertEqual(TT.find(*inp), exp) - - def test_find__type_or_id(self): - ies = (((None, PRS, "json"), A3()), - ((None, PRS, "yaml"), B()), - ((None, PRS, "dummy"), C()), - ) - for inp, exp in ies: - self.assertEqual(TT.find(*inp), exp) - -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize( + ("items", "exp"), + (([], []), + (((["a"], 1), ), [("a", [1])]), + (((["a", "aaa"], 1), (["b", "bb"], 2), (["a"], 3)), + [("a", [1, 3]), ("aaa", [1]), ("b", [2]), ("bb", [2])]) + ), +) +def test_select_by_key( + items: collections.abc.Iterable, exp: collections.abc.Iterable +): + assert TT.select_by_key(items) == exp + + +@pytest.mark.parametrize( + ("items", "exp"), + ((((["a", "aaa"], 1), (["a"], 3)), [("a", [3, 1]), ("aaa", [1])]), + ), +) +def test_select_by_key_reversed( + items: collections.abc.Iterable, exp: collections.abc.Iterable +): + def sfn(itr): + return sorted(itr, reverse=True) + + assert TT.select_by_key(items, sfn) == exp + + +PRS10 = (AI0, AI2, AI3, BI0, CI0) = (A(), A2(), A3(), B(), C()) +OBJ0 = anyconfig.ioinfo.make("/path/to/a.json") + + +@pytest.mark.parametrize( + ("items", "exp"), + ((([], "type"), []), + (([AI0], "type"), [(AI0.type(), [AI0])]), + (([AI0], "extensions"), [(x, [AI0]) for x in AI0.extensions()]), + (((AI0, AI2, AI3), "type"), [(AI0.type(), [AI3, AI2, AI0])]), + (([AI0, BI0, CI0], "type"), + [(AI0.type(), [AI0]), (BI0.type(), [BI0, CI0])]), + ((PRS, "type"), + [(AI0.type(), [AI3, AI2, AI0]), (BI0.type(), [BI0, CI0])]), + ((PRS, "extensions"), + [("js", [AI3, AI2, AI0]), ("json", [AI3, AI2, AI0]), + ("jsn", [AI3, AI2, AI0]), ("yaml", [BI0, CI0]), ("yml", [BI0, CI0])]), + ), +) +def test_list_by_x( + items: collections.abc.Iterable, exp: collections.abc.Iterable +) -> None: + assert sorted(TT.list_by_x(*items)) == sorted(exp) + + +def test_list_by_x_ng_cases(): + with pytest.raises(ValueError): + TT.list_by_x(PRS, "undef") + + +@pytest.mark.parametrize( + ("typ", "exp"), + (("json", [AI3, AI2, AI0]), + ("yaml", [BI0, CI0]), + ("undefined", []) + ), +) +def test_findall_with_pred__type( + typ: str, exp: collections.abc.Iterable +) -> None: + def _findall_by_type(typ): + return TT.findall_with_pred(lambda p: p.type() == typ, PRS) + + assert _findall_by_type(typ) == exp + + +@pytest.mark.parametrize( + ("typ", "exp"), + (("js", [AI3, AI2, AI0]), + ("yml", [BI0, CI0]), + ("xyz", []), + ), +) +def test_findall_with_pred__ext( + typ: str, exp: collections.abc.Iterable +) -> None: + def _findall_with_pred__ext(ext): + return TT.findall_with_pred(lambda p: ext in p.extensions(), PRS) + + assert _findall_with_pred__ext(typ) == exp + + +@pytest.mark.parametrize( + ("items", "exp"), + (((AI3, A3), True), + ((A3, A3), True), + ((B, A3), False), + ), +) +def test_maybe_processor( + items: collections.abc.Iterable, exp: bool +) -> None: + res = TT.maybe_processor(*items) + if exp: + assert isinstance(res, A3) + else: + assert not isinstance(res, A3) + assert res is None + + +@pytest.mark.parametrize( + ("typ_prs", "exp"), + ((("json", PRS), [AI3, AI2, AI0]), + (("yaml", PRS), [BI0, CI0]), + (("dummy", PRS), [CI0]), + ), +) +def test_find_by_type_or_id( + typ_prs: collections.abc.Iterable, exp: collections.abc.Iterable +) -> None: + assert TT.find_by_type_or_id(*typ_prs) == exp + + +def test_find_by_type_or_id_ng_cases() -> None: + with pytest.raises(UnknownProcessorTypeError): + TT.find_by_type_or_id("xyz", PRS) + + +@pytest.mark.parametrize( + ("typ_prs", "exp"), + ((("js", PRS), [A3(), A2(), A()]), + (("yml", PRS), [B(), C()]), + ), +) +def test_find_by_fileext( + typ_prs: collections.abc.Iterable, exp: collections.abc.Iterable +) -> None: + assert TT.find_by_fileext(*typ_prs) == exp + + +def test_find_by_fileext_ng_cases(): + with pytest.raises(UnknownFileTypeError): + TT.find_by_fileext("xyz", PRS) + + +@pytest.mark.parametrize( + ("objs", "exp"), + ((("/path/to/a.jsn", PRS), [AI3, AI2, AI0]), + (("../../path/to/b.yml", PRS), [BI0, CI0]), + ((OBJ0, PRS), [AI3, AI2, AI0]), + ) +) +def test_find_by_maybe_file(objs, exp): + assert TT.find_by_maybe_file(*objs) == exp + + +@pytest.mark.parametrize( + ("obj", ), + (("/tmp/x.xyz", ), + ("/dev/null", ), + ) +) +def test_find_by_maybe_file_ng_cases(obj): + with pytest.raises(UnknownFileTypeError): + TT.find_by_maybe_file(obj, PRS) + + +@pytest.mark.parametrize( + ("obj", "typ", "exc"), + ((None, None, ValueError), # w/o path nor type + ("/tmp/x.xyz", None, UnknownFileTypeError), + ("/dev/null", None, UnknownFileTypeError), + (None, "xyz", UnknownProcessorTypeError), + ) +) +def test_findall_ng_cases(obj, typ, exc): + with pytest.raises(exc): + TT.findall(obj, PRS, forced_type=typ) + + +@pytest.mark.parametrize( + ("obj", "exp"), + (("/path/to/a.jsn", [AI3, AI2, AI0]), + ("../../path/to/b.yml", [BI0, CI0]), + (OBJ0, [AI3, AI2, AI0]), + ) +) +def test_findall_by_maybe_file(obj, exp): + assert TT.findall(obj, PRS) == exp + + +@pytest.mark.parametrize( + ("typ", "exp"), + (("json", [AI3, AI2, AI0]), + ("yaml", [BI0, CI0]), + ("dummy", [CI0]), + ) +) +def test_findall_by_type_or_id(typ, exp): + assert TT.findall(None, PRS, forced_type=typ) == exp + + +@pytest.mark.parametrize( + ("typ", "exp"), + ((A2, AI2), + (CI0.cid(), CI0), + ) +) +def test_find_by_forced_type(typ, exp): + assert TT.find(None, PRS, forced_type=typ) == exp + + +@pytest.mark.parametrize( + ("obj", "exp"), + (("/path/to/a.jsn", AI3), + ("../../path/to/b.yml", BI0), + (OBJ0, AI3), + ) +) +def test_find__maybe_file(obj, exp): + assert TT.find(obj, PRS) == exp + + +@pytest.mark.parametrize( + ("typ", "exp"), + (("json", A3()), + ("yaml", B()), + ("dummy", C()), + ) +) +def test_find__type_or_id(typ, exp): + assert TT.find(None, PRS, forced_type=typ) == exp diff --git a/tests/query/test_query.py b/tests/query/test_query.py index 90c801d7..bc2a07a6 100644 --- a/tests/query/test_query.py +++ b/tests/query/test_query.py @@ -1,44 +1,31 @@ # -# Copyright (C) 2017 - 2021 Satoru SATOH +# Copyright (C) 2017 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring, invalid-name -"""test cases for anyconfig.query.query. -""" -import os -import unittest +# pylint: disable=missing-docstring +"""test cases for anyconfig.query.query.""" +from __future__ import annotations + +import pytest try: import anyconfig.query.query as TT -except ImportError: - raise unittest.SkipTest('Needed library to query was not found') - - -class Test_00_Functions(unittest.TestCase): - - def _assert_dicts_equal(self, dic, ref): - self.assertEqual(dic, ref, - "%r%s vs.%s%r" % (dic, os.linesep, os.linesep, ref)) - - def _assert_query(self, data_exp_ref_list, dicts=False): - _assert = self._assert_dicts_equal if dicts else self.assertEqual - for data, exp, ref in data_exp_ref_list: - try: - _assert(TT.query(data, exp)[0], ref) - except ValueError: - pass - - def test_10_query(self): - self._assert_query([({"a": 1}, "a", 1), - ({"a": {"b": 2}}, "a.b", 2)]) - - def test_12_invalid_query(self): - data = {"a": 1} - self._assert_query([(data, "b.", data)]) - - def test_14_empty_query(self): - data = {"a": 1} - self._assert_query([(data, None, data), - (data, '', data)]) - -# vim:sw=4:ts=4:et: +except ImportError as exc: + raise pytest.skip( + "Needed library to query was not found", + allow_module_leve=True + ) from exc + + +@pytest.mark.parametrize( + ("data", "query", "exp"), + (({"a": 1}, "a", 1), + ({"a": {"b": 2}}, "a.b", 2), + ({"a": 1}, "b.", {"a": 1}), + ({"a": 1}, None, {"a": 1}), + ({"a": 1}, "", {"a": 1}), + ), +) +def test_query(data, query: str, exp): + (res, _exc) = TT.query(data, query) + assert res == exp diff --git a/tests/requirements.d/test.txt b/tests/requirements.d/test.txt index 5900951d..f61ff272 100644 --- a/tests/requirements.d/test.txt +++ b/tests/requirements.d/test.txt @@ -1,4 +1,5 @@ coveralls pytest +pytest-clarity pytest-cov pytest-randomly diff --git a/tests/res/1/api/dump b/tests/res/1/api/dump new file mode 120000 index 00000000..36f48c71 --- /dev/null +++ b/tests/res/1/api/dump @@ -0,0 +1 @@ +dumps \ No newline at end of file diff --git a/tests/res/1/api/dumps/basics/10/00.json b/tests/res/1/api/dumps/basics/10/00.json new file mode 120000 index 00000000..0c5cd86a --- /dev/null +++ b/tests/res/1/api/dumps/basics/10/00.json @@ -0,0 +1 @@ +../../../single_load/basics/10/00.json \ No newline at end of file diff --git a/tests/res/1/api/dumps/basics/10/10.json b/tests/res/1/api/dumps/basics/10/10.json new file mode 120000 index 00000000..5247a50b --- /dev/null +++ b/tests/res/1/api/dumps/basics/10/10.json @@ -0,0 +1 @@ +../../../single_load/basics/10/10.json \ No newline at end of file diff --git a/tests/res/1/api/dumps/basics/10/20.json b/tests/res/1/api/dumps/basics/10/20.json new file mode 120000 index 00000000..661a4269 --- /dev/null +++ b/tests/res/1/api/dumps/basics/10/20.json @@ -0,0 +1 @@ +../../../single_load/basics/10/20.json \ No newline at end of file diff --git a/tests/res/dump/basics/10/e/00.txt b/tests/res/1/api/dumps/basics/10/e/00.txt similarity index 100% rename from tests/res/dump/basics/10/e/00.txt rename to tests/res/1/api/dumps/basics/10/e/00.txt diff --git a/tests/res/dump/basics/10/e/10.txt b/tests/res/1/api/dumps/basics/10/e/10.txt similarity index 100% rename from tests/res/dump/basics/10/e/10.txt rename to tests/res/1/api/dumps/basics/10/e/10.txt diff --git a/tests/res/dump/basics/10/e/20.txt b/tests/res/1/api/dumps/basics/10/e/20.txt similarity index 100% rename from tests/res/dump/basics/10/e/20.txt rename to tests/res/1/api/dumps/basics/10/e/20.txt diff --git a/tests/res/dumps/basics/10/o/00.json b/tests/res/1/api/dumps/basics/10/o/00.json similarity index 100% rename from tests/res/dumps/basics/10/o/00.json rename to tests/res/1/api/dumps/basics/10/o/00.json diff --git a/tests/res/dicts/get/20/10.json b/tests/res/1/api/dumps/basics/10/o/10.json similarity index 100% rename from tests/res/dicts/get/20/10.json rename to tests/res/1/api/dumps/basics/10/o/10.json diff --git a/tests/res/dicts/get/20/20.json b/tests/res/1/api/dumps/basics/10/o/20.json similarity index 100% rename from tests/res/dicts/get/20/20.json rename to tests/res/1/api/dumps/basics/10/o/20.json diff --git a/tests/res/1/api/dumps/basics/20/00.json b/tests/res/1/api/dumps/basics/20/00.json new file mode 120000 index 00000000..af40a2e9 --- /dev/null +++ b/tests/res/1/api/dumps/basics/20/00.json @@ -0,0 +1 @@ +../../../single_load/basics/20/00.json \ No newline at end of file diff --git a/tests/res/1/api/dumps/basics/20/10.json b/tests/res/1/api/dumps/basics/20/10.json new file mode 120000 index 00000000..20463277 --- /dev/null +++ b/tests/res/1/api/dumps/basics/20/10.json @@ -0,0 +1 @@ +../../../single_load/basics/20/10.json \ No newline at end of file diff --git a/tests/res/1/api/dumps/basics/20/20.json b/tests/res/1/api/dumps/basics/20/20.json new file mode 120000 index 00000000..b5b93429 --- /dev/null +++ b/tests/res/1/api/dumps/basics/20/20.json @@ -0,0 +1 @@ +../../../single_load/basics/20/20.json \ No newline at end of file diff --git a/tests/res/dump/basics/20/e/00.txt b/tests/res/1/api/dumps/basics/20/e/00.txt similarity index 100% rename from tests/res/dump/basics/20/e/00.txt rename to tests/res/1/api/dumps/basics/20/e/00.txt diff --git a/tests/res/dump/basics/20/e/10.txt b/tests/res/1/api/dumps/basics/20/e/10.txt similarity index 100% rename from tests/res/dump/basics/20/e/10.txt rename to tests/res/1/api/dumps/basics/20/e/10.txt diff --git a/tests/res/dump/basics/20/e/20.txt b/tests/res/1/api/dumps/basics/20/e/20.txt similarity index 100% rename from tests/res/dump/basics/20/e/20.txt rename to tests/res/1/api/dumps/basics/20/e/20.txt diff --git a/tests/res/dumps/basics/20/o/00.json b/tests/res/1/api/dumps/basics/20/o/00.json similarity index 100% rename from tests/res/dumps/basics/20/o/00.json rename to tests/res/1/api/dumps/basics/20/o/00.json diff --git a/tests/res/dump/basics/10/o/10.json b/tests/res/1/api/dumps/basics/20/o/10.json similarity index 100% rename from tests/res/dump/basics/10/o/10.json rename to tests/res/1/api/dumps/basics/20/o/10.json diff --git a/tests/res/dump/basics/10/o/20.json b/tests/res/1/api/dumps/basics/20/o/20.json similarity index 100% rename from tests/res/dump/basics/10/o/20.json rename to tests/res/1/api/dumps/basics/20/o/20.json diff --git a/tests/res/load/multi b/tests/res/1/api/load/multi_load similarity index 100% rename from tests/res/load/multi rename to tests/res/1/api/load/multi_load diff --git a/tests/res/load/single b/tests/res/1/api/load/single_load similarity index 100% rename from tests/res/load/single rename to tests/res/1/api/load/single_load diff --git a/tests/res/1/api/loads/basics/10/00.txt b/tests/res/1/api/loads/basics/10/00.txt new file mode 120000 index 00000000..0c5cd86a --- /dev/null +++ b/tests/res/1/api/loads/basics/10/00.txt @@ -0,0 +1 @@ +../../../single_load/basics/10/00.json \ No newline at end of file diff --git a/tests/res/1/api/loads/basics/10/10.txt b/tests/res/1/api/loads/basics/10/10.txt new file mode 120000 index 00000000..5247a50b --- /dev/null +++ b/tests/res/1/api/loads/basics/10/10.txt @@ -0,0 +1 @@ +../../../single_load/basics/10/10.json \ No newline at end of file diff --git a/tests/res/1/api/loads/basics/10/20.txt b/tests/res/1/api/loads/basics/10/20.txt new file mode 120000 index 00000000..661a4269 --- /dev/null +++ b/tests/res/1/api/loads/basics/10/20.txt @@ -0,0 +1 @@ +../../../single_load/basics/10/20.json \ No newline at end of file diff --git a/tests/res/loads/basics/10/e/00.json b/tests/res/1/api/loads/basics/10/e/00.json similarity index 100% rename from tests/res/loads/basics/10/e/00.json rename to tests/res/1/api/loads/basics/10/e/00.json diff --git a/tests/res/loads/basics/10/e/10.json b/tests/res/1/api/loads/basics/10/e/10.json similarity index 100% rename from tests/res/loads/basics/10/e/10.json rename to tests/res/1/api/loads/basics/10/e/10.json diff --git a/tests/res/loads/basics/10/e/20.json b/tests/res/1/api/loads/basics/10/e/20.json similarity index 100% rename from tests/res/loads/basics/10/e/20.json rename to tests/res/1/api/loads/basics/10/e/20.json diff --git a/tests/res/loads/basics/10/o/00.json b/tests/res/1/api/loads/basics/10/o/00.json similarity index 100% rename from tests/res/loads/basics/10/o/00.json rename to tests/res/1/api/loads/basics/10/o/00.json diff --git a/tests/res/dump/basics/20/o/10.json b/tests/res/1/api/loads/basics/10/o/10.json similarity index 100% rename from tests/res/dump/basics/20/o/10.json rename to tests/res/1/api/loads/basics/10/o/10.json diff --git a/tests/res/dump/basics/20/o/20.json b/tests/res/1/api/loads/basics/10/o/20.json similarity index 100% rename from tests/res/dump/basics/20/o/20.json rename to tests/res/1/api/loads/basics/10/o/20.json diff --git a/tests/res/1/api/loads/query/10/00_00.txt b/tests/res/1/api/loads/query/10/00_00.txt new file mode 120000 index 00000000..5974c6e1 --- /dev/null +++ b/tests/res/1/api/loads/query/10/00_00.txt @@ -0,0 +1 @@ +../../../single_load/query/10/00_00.json \ No newline at end of file diff --git a/tests/res/1/api/loads/query/10/00_10.txt b/tests/res/1/api/loads/query/10/00_10.txt new file mode 120000 index 00000000..385f168e --- /dev/null +++ b/tests/res/1/api/loads/query/10/00_10.txt @@ -0,0 +1 @@ +../../../single_load/query/10/00_10.json \ No newline at end of file diff --git a/tests/res/1/api/loads/query/10/10_00.txt b/tests/res/1/api/loads/query/10/10_00.txt new file mode 120000 index 00000000..328240fe --- /dev/null +++ b/tests/res/1/api/loads/query/10/10_00.txt @@ -0,0 +1 @@ +../../../single_load/query/10/10_00.json \ No newline at end of file diff --git a/tests/res/1/api/loads/query/10/10_10.txt b/tests/res/1/api/loads/query/10/10_10.txt new file mode 120000 index 00000000..388a8826 --- /dev/null +++ b/tests/res/1/api/loads/query/10/10_10.txt @@ -0,0 +1 @@ +../../../single_load/query/10/10_10.json \ No newline at end of file diff --git a/tests/res/1/api/loads/query/10/10_20.txt b/tests/res/1/api/loads/query/10/10_20.txt new file mode 120000 index 00000000..8d377b68 --- /dev/null +++ b/tests/res/1/api/loads/query/10/10_20.txt @@ -0,0 +1 @@ +../../../single_load/query/10/10_20.json \ No newline at end of file diff --git a/tests/res/1/api/loads/query/10/10_30.txt b/tests/res/1/api/loads/query/10/10_30.txt new file mode 120000 index 00000000..b13a05b8 --- /dev/null +++ b/tests/res/1/api/loads/query/10/10_30.txt @@ -0,0 +1 @@ +../../../single_load/query/10/10_30.json \ No newline at end of file diff --git a/tests/res/1/api/loads/query/10/10_40.txt b/tests/res/1/api/loads/query/10/10_40.txt new file mode 120000 index 00000000..7d600c64 --- /dev/null +++ b/tests/res/1/api/loads/query/10/10_40.txt @@ -0,0 +1 @@ +../../../single_load/query/10/10_40.json \ No newline at end of file diff --git a/tests/res/1/api/loads/query/10/10_50.txt b/tests/res/1/api/loads/query/10/10_50.txt new file mode 120000 index 00000000..46725333 --- /dev/null +++ b/tests/res/1/api/loads/query/10/10_50.txt @@ -0,0 +1 @@ +../../../single_load/query/10/10_50.json \ No newline at end of file diff --git a/tests/res/1/api/loads/query/10/20_00.txt b/tests/res/1/api/loads/query/10/20_00.txt new file mode 120000 index 00000000..82054765 --- /dev/null +++ b/tests/res/1/api/loads/query/10/20_00.txt @@ -0,0 +1 @@ +../../../single_load/query/10/20_00.json \ No newline at end of file diff --git a/tests/res/1/api/loads/query/10/20_10.txt b/tests/res/1/api/loads/query/10/20_10.txt new file mode 120000 index 00000000..f691a000 --- /dev/null +++ b/tests/res/1/api/loads/query/10/20_10.txt @@ -0,0 +1 @@ +../../../single_load/query/10/20_10.json \ No newline at end of file diff --git a/tests/res/1/api/loads/query/10/20_20.txt b/tests/res/1/api/loads/query/10/20_20.txt new file mode 120000 index 00000000..0a5f5e2f --- /dev/null +++ b/tests/res/1/api/loads/query/10/20_20.txt @@ -0,0 +1 @@ +../../../single_load/query/10/20_20.json \ No newline at end of file diff --git a/tests/res/1/api/loads/query/10/e b/tests/res/1/api/loads/query/10/e new file mode 120000 index 00000000..d8d2526b --- /dev/null +++ b/tests/res/1/api/loads/query/10/e @@ -0,0 +1 @@ +../../../single_load/query/10/e \ No newline at end of file diff --git a/tests/res/loads/query/10/o/00_00.json b/tests/res/1/api/loads/query/10/o/00_00.json similarity index 100% rename from tests/res/loads/query/10/o/00_00.json rename to tests/res/1/api/loads/query/10/o/00_00.json diff --git a/tests/res/loads/query/10/o/00_10.json b/tests/res/1/api/loads/query/10/o/00_10.json similarity index 100% rename from tests/res/loads/query/10/o/00_10.json rename to tests/res/1/api/loads/query/10/o/00_10.json diff --git a/tests/res/json/query/e/10_00.json b/tests/res/1/api/loads/query/10/o/10_00.json similarity index 100% rename from tests/res/json/query/e/10_00.json rename to tests/res/1/api/loads/query/10/o/10_00.json diff --git a/tests/res/loads/query/10/o/10_10.json b/tests/res/1/api/loads/query/10/o/10_10.json similarity index 100% rename from tests/res/loads/query/10/o/10_10.json rename to tests/res/1/api/loads/query/10/o/10_10.json diff --git a/tests/res/loads/query/10/o/10_20.json b/tests/res/1/api/loads/query/10/o/10_20.json similarity index 100% rename from tests/res/loads/query/10/o/10_20.json rename to tests/res/1/api/loads/query/10/o/10_20.json diff --git a/tests/res/loads/query/10/o/10_30.json b/tests/res/1/api/loads/query/10/o/10_30.json similarity index 100% rename from tests/res/loads/query/10/o/10_30.json rename to tests/res/1/api/loads/query/10/o/10_30.json diff --git a/tests/res/loads/query/10/o/10_40.json b/tests/res/1/api/loads/query/10/o/10_40.json similarity index 100% rename from tests/res/loads/query/10/o/10_40.json rename to tests/res/1/api/loads/query/10/o/10_40.json diff --git a/tests/res/json/query/e/20_00.json b/tests/res/1/api/loads/query/10/o/10_50.json similarity index 100% rename from tests/res/json/query/e/20_00.json rename to tests/res/1/api/loads/query/10/o/10_50.json diff --git a/tests/res/loads/query/10/o/20_00.json b/tests/res/1/api/loads/query/10/o/20_00.json similarity index 100% rename from tests/res/loads/query/10/o/20_00.json rename to tests/res/1/api/loads/query/10/o/20_00.json diff --git a/tests/res/loads/query/10/o/20_10.json b/tests/res/1/api/loads/query/10/o/20_10.json similarity index 100% rename from tests/res/loads/query/10/o/20_10.json rename to tests/res/1/api/loads/query/10/o/20_10.json diff --git a/tests/res/loads/query/10/o/20_20.json b/tests/res/1/api/loads/query/10/o/20_20.json similarity index 100% rename from tests/res/loads/query/10/o/20_20.json rename to tests/res/1/api/loads/query/10/o/20_20.json diff --git a/tests/res/1/api/loads/query/10/q b/tests/res/1/api/loads/query/10/q new file mode 120000 index 00000000..5169604f --- /dev/null +++ b/tests/res/1/api/loads/query/10/q @@ -0,0 +1 @@ +../../../single_load/query/10/q \ No newline at end of file diff --git a/tests/res/1/api/loads/schema/10/00.txt b/tests/res/1/api/loads/schema/10/00.txt new file mode 120000 index 00000000..7feafc4e --- /dev/null +++ b/tests/res/1/api/loads/schema/10/00.txt @@ -0,0 +1 @@ +../../../single_load/schema//10/00.json \ No newline at end of file diff --git a/tests/res/1/api/loads/schema/10/10.txt b/tests/res/1/api/loads/schema/10/10.txt new file mode 120000 index 00000000..0817d222 --- /dev/null +++ b/tests/res/1/api/loads/schema/10/10.txt @@ -0,0 +1 @@ +../../../single_load/schema//10/10.json \ No newline at end of file diff --git a/tests/res/1/api/loads/schema/10/20.txt b/tests/res/1/api/loads/schema/10/20.txt new file mode 120000 index 00000000..e14ac3af --- /dev/null +++ b/tests/res/1/api/loads/schema/10/20.txt @@ -0,0 +1 @@ +../../../single_load/schema//10/20.json \ No newline at end of file diff --git a/tests/res/loads/schema/10/e b/tests/res/1/api/loads/schema/10/e similarity index 100% rename from tests/res/loads/schema/10/e rename to tests/res/1/api/loads/schema/10/e diff --git a/tests/res/loads/schema/10/o b/tests/res/1/api/loads/schema/10/o similarity index 100% rename from tests/res/loads/schema/10/o rename to tests/res/1/api/loads/schema/10/o diff --git a/tests/res/1/api/loads/schema/10/s/00.txt b/tests/res/1/api/loads/schema/10/s/00.txt new file mode 120000 index 00000000..888d8dd8 --- /dev/null +++ b/tests/res/1/api/loads/schema/10/s/00.txt @@ -0,0 +1 @@ +../../../../single_load/schema/10/s/00.json \ No newline at end of file diff --git a/tests/res/1/api/loads/schema/10/s/10.txt b/tests/res/1/api/loads/schema/10/s/10.txt new file mode 120000 index 00000000..b64fd712 --- /dev/null +++ b/tests/res/1/api/loads/schema/10/s/10.txt @@ -0,0 +1 @@ +../../../../single_load/schema/10/s/10.json \ No newline at end of file diff --git a/tests/res/1/api/loads/schema/10/s/20.txt b/tests/res/1/api/loads/schema/10/s/20.txt new file mode 120000 index 00000000..c0b8448a --- /dev/null +++ b/tests/res/1/api/loads/schema/10/s/20.txt @@ -0,0 +1 @@ +../../../../single_load/schema/10/s/20.json \ No newline at end of file diff --git a/tests/res/1/api/loads/template/10/00.txt b/tests/res/1/api/loads/template/10/00.txt new file mode 120000 index 00000000..e72201f1 --- /dev/null +++ b/tests/res/1/api/loads/template/10/00.txt @@ -0,0 +1 @@ +../../../single_load/template/10/00.j2 \ No newline at end of file diff --git a/tests/res/1/api/loads/template/10/10.txt b/tests/res/1/api/loads/template/10/10.txt new file mode 120000 index 00000000..ed2a42a2 --- /dev/null +++ b/tests/res/1/api/loads/template/10/10.txt @@ -0,0 +1 @@ +../../../single_load/template/10/10.j2 \ No newline at end of file diff --git a/tests/res/1/api/loads/template/10/20.txt b/tests/res/1/api/loads/template/10/20.txt new file mode 120000 index 00000000..b48229f1 --- /dev/null +++ b/tests/res/1/api/loads/template/10/20.txt @@ -0,0 +1 @@ +../../../single_load/template/10/20.j2 \ No newline at end of file diff --git a/tests/res/1/api/loads/template/10/30.txt b/tests/res/1/api/loads/template/10/30.txt new file mode 120000 index 00000000..f0d4fad0 --- /dev/null +++ b/tests/res/1/api/loads/template/10/30.txt @@ -0,0 +1 @@ +../../../single_load/template/10/30.j2 \ No newline at end of file diff --git a/tests/res/1/api/loads/template/10/c b/tests/res/1/api/loads/template/10/c new file mode 120000 index 00000000..7e59bdfe --- /dev/null +++ b/tests/res/1/api/loads/template/10/c @@ -0,0 +1 @@ +../../../single_load/template/10/c \ No newline at end of file diff --git a/tests/res/1/api/loads/template/10/e b/tests/res/1/api/loads/template/10/e new file mode 120000 index 00000000..2ecd3b9a --- /dev/null +++ b/tests/res/1/api/loads/template/10/e @@ -0,0 +1 @@ +../../../single_load/template/10/e \ No newline at end of file diff --git a/tests/res/loads/template/10/o/00.json b/tests/res/1/api/loads/template/10/o/00.json similarity index 100% rename from tests/res/loads/template/10/o/00.json rename to tests/res/1/api/loads/template/10/o/00.json diff --git a/tests/res/dumps/basics/10/o/10.json b/tests/res/1/api/loads/template/10/o/10.json similarity index 100% rename from tests/res/dumps/basics/10/o/10.json rename to tests/res/1/api/loads/template/10/o/10.json diff --git a/tests/res/dumps/basics/10/o/20.json b/tests/res/1/api/loads/template/10/o/20.json similarity index 100% rename from tests/res/dumps/basics/10/o/20.json rename to tests/res/1/api/loads/template/10/o/20.json diff --git a/tests/res/dicts/get/20/30.json b/tests/res/1/api/loads/template/10/o/30.json similarity index 100% rename from tests/res/dicts/get/20/30.json rename to tests/res/1/api/loads/template/10/o/30.json diff --git a/tests/res/json/basic/00.json b/tests/res/1/api/multi_load/basics/00/00.json similarity index 100% rename from tests/res/json/basic/00.json rename to tests/res/1/api/multi_load/basics/00/00.json diff --git a/tests/res/multi_load/basics/00/10.json b/tests/res/1/api/multi_load/basics/00/10.json similarity index 100% rename from tests/res/multi_load/basics/00/10.json rename to tests/res/1/api/multi_load/basics/00/10.json diff --git a/tests/res/multi_load/basics/00/20.json b/tests/res/1/api/multi_load/basics/00/20.json similarity index 100% rename from tests/res/multi_load/basics/00/20.json rename to tests/res/1/api/multi_load/basics/00/20.json diff --git a/tests/res/multi_load/basics/00/30.json b/tests/res/1/api/multi_load/basics/00/30.json similarity index 100% rename from tests/res/multi_load/basics/00/30.json rename to tests/res/1/api/multi_load/basics/00/30.json diff --git a/tests/res/multi_load/basics/00/40.json b/tests/res/1/api/multi_load/basics/00/40.json similarity index 100% rename from tests/res/multi_load/basics/00/40.json rename to tests/res/1/api/multi_load/basics/00/40.json diff --git a/tests/res/json/basic/20.json b/tests/res/1/api/multi_load/basics/00/e/00.json similarity index 100% rename from tests/res/json/basic/20.json rename to tests/res/1/api/multi_load/basics/00/e/00.json diff --git a/tests/res/dump/basics/10/o/00.json b/tests/res/1/api/multi_load/basics/00/o/00.json similarity index 100% rename from tests/res/dump/basics/10/o/00.json rename to tests/res/1/api/multi_load/basics/00/o/00.json diff --git a/tests/res/multi_load/schema/00/s/00.json b/tests/res/1/api/multi_load/basics/00/s/00.json similarity index 100% rename from tests/res/multi_load/schema/00/s/00.json rename to tests/res/1/api/multi_load/basics/00/s/00.json diff --git a/tests/res/multi_load/basics/10/00.json b/tests/res/1/api/multi_load/basics/10/00.json similarity index 100% rename from tests/res/multi_load/basics/10/00.json rename to tests/res/1/api/multi_load/basics/10/00.json diff --git a/tests/res/multi_load/basics/10/10.json b/tests/res/1/api/multi_load/basics/10/10.json similarity index 100% rename from tests/res/multi_load/basics/10/10.json rename to tests/res/1/api/multi_load/basics/10/10.json diff --git a/tests/res/multi_load/basics/10/20.json b/tests/res/1/api/multi_load/basics/10/20.json similarity index 100% rename from tests/res/multi_load/basics/10/20.json rename to tests/res/1/api/multi_load/basics/10/20.json diff --git a/tests/res/multi_load/basics/10/30.json b/tests/res/1/api/multi_load/basics/10/30.json similarity index 100% rename from tests/res/multi_load/basics/10/30.json rename to tests/res/1/api/multi_load/basics/10/30.json diff --git a/tests/res/multi_load/basics/10/40.json b/tests/res/1/api/multi_load/basics/10/40.json similarity index 100% rename from tests/res/multi_load/basics/10/40.json rename to tests/res/1/api/multi_load/basics/10/40.json diff --git a/tests/res/multi_load/basics/10/50.json b/tests/res/1/api/multi_load/basics/10/50.json similarity index 100% rename from tests/res/multi_load/basics/10/50.json rename to tests/res/1/api/multi_load/basics/10/50.json diff --git a/tests/res/multi_load/basics/10/e b/tests/res/1/api/multi_load/basics/10/e similarity index 100% rename from tests/res/multi_load/basics/10/e rename to tests/res/1/api/multi_load/basics/10/e diff --git a/tests/res/multi_load/basics/10/o/00.json b/tests/res/1/api/multi_load/basics/10/o/00.json similarity index 100% rename from tests/res/multi_load/basics/10/o/00.json rename to tests/res/1/api/multi_load/basics/10/o/00.json diff --git a/tests/res/multi_load/basics/20/00.json b/tests/res/1/api/multi_load/basics/20/00.json similarity index 100% rename from tests/res/multi_load/basics/20/00.json rename to tests/res/1/api/multi_load/basics/20/00.json diff --git a/tests/res/multi_load/basics/20/10.json b/tests/res/1/api/multi_load/basics/20/10.json similarity index 100% rename from tests/res/multi_load/basics/20/10.json rename to tests/res/1/api/multi_load/basics/20/10.json diff --git a/tests/res/multi_load/basics/20/20.json b/tests/res/1/api/multi_load/basics/20/20.json similarity index 100% rename from tests/res/multi_load/basics/20/20.json rename to tests/res/1/api/multi_load/basics/20/20.json diff --git a/tests/res/multi_load/basics/20/30.json b/tests/res/1/api/multi_load/basics/20/30.json similarity index 100% rename from tests/res/multi_load/basics/20/30.json rename to tests/res/1/api/multi_load/basics/20/30.json diff --git a/tests/res/multi_load/basics/20/40.json b/tests/res/1/api/multi_load/basics/20/40.json similarity index 100% rename from tests/res/multi_load/basics/20/40.json rename to tests/res/1/api/multi_load/basics/20/40.json diff --git a/tests/res/multi_load/basics/20/50.json b/tests/res/1/api/multi_load/basics/20/50.json similarity index 100% rename from tests/res/multi_load/basics/20/50.json rename to tests/res/1/api/multi_load/basics/20/50.json diff --git a/tests/res/multi_load/basics/20/e/exp.json b/tests/res/1/api/multi_load/basics/20/e/00.json similarity index 100% rename from tests/res/multi_load/basics/20/e/exp.json rename to tests/res/1/api/multi_load/basics/20/e/00.json diff --git a/tests/res/multi_load/basics/20/o/00.json b/tests/res/1/api/multi_load/basics/20/o/00.json similarity index 100% rename from tests/res/multi_load/basics/20/o/00.json rename to tests/res/1/api/multi_load/basics/20/o/00.json diff --git a/tests/res/multi_load/basics/30/00.json b/tests/res/1/api/multi_load/basics/30/00.json similarity index 100% rename from tests/res/multi_load/basics/30/00.json rename to tests/res/1/api/multi_load/basics/30/00.json diff --git a/tests/res/multi_load/basics/30/10.json b/tests/res/1/api/multi_load/basics/30/10.json similarity index 100% rename from tests/res/multi_load/basics/30/10.json rename to tests/res/1/api/multi_load/basics/30/10.json diff --git a/tests/res/multi_load/basics/30/20.json b/tests/res/1/api/multi_load/basics/30/20.json similarity index 100% rename from tests/res/multi_load/basics/30/20.json rename to tests/res/1/api/multi_load/basics/30/20.json diff --git a/tests/res/multi_load/basics/30/30.json b/tests/res/1/api/multi_load/basics/30/30.json similarity index 100% rename from tests/res/multi_load/basics/30/30.json rename to tests/res/1/api/multi_load/basics/30/30.json diff --git a/tests/res/multi_load/basics/30/40.json b/tests/res/1/api/multi_load/basics/30/40.json similarity index 100% rename from tests/res/multi_load/basics/30/40.json rename to tests/res/1/api/multi_load/basics/30/40.json diff --git a/tests/res/multi_load/basics/30/50.json b/tests/res/1/api/multi_load/basics/30/50.json similarity index 100% rename from tests/res/multi_load/basics/30/50.json rename to tests/res/1/api/multi_load/basics/30/50.json diff --git a/tests/res/multi_load/basics/30/e/exp.json b/tests/res/1/api/multi_load/basics/30/e/00.json similarity index 100% rename from tests/res/multi_load/basics/30/e/exp.json rename to tests/res/1/api/multi_load/basics/30/e/00.json diff --git a/tests/res/multi_load/basics/30/o/00.json b/tests/res/1/api/multi_load/basics/30/o/00.json similarity index 100% rename from tests/res/multi_load/basics/30/o/00.json rename to tests/res/1/api/multi_load/basics/30/o/00.json diff --git a/tests/res/multi_load/multi_types/10/00.json b/tests/res/1/api/multi_load/multi_types/10/00.json similarity index 100% rename from tests/res/multi_load/multi_types/10/00.json rename to tests/res/1/api/multi_load/multi_types/10/00.json diff --git a/tests/res/multi_load/multi_types/10/10.ini b/tests/res/1/api/multi_load/multi_types/10/10.ini similarity index 100% rename from tests/res/multi_load/multi_types/10/10.ini rename to tests/res/1/api/multi_load/multi_types/10/10.ini diff --git a/tests/res/multi_load/multi_types/10/20.json b/tests/res/1/api/multi_load/multi_types/10/20.json similarity index 100% rename from tests/res/multi_load/multi_types/10/20.json rename to tests/res/1/api/multi_load/multi_types/10/20.json diff --git a/tests/res/multi_load/multi_types/10/30.json b/tests/res/1/api/multi_load/multi_types/10/30.json similarity index 100% rename from tests/res/multi_load/multi_types/10/30.json rename to tests/res/1/api/multi_load/multi_types/10/30.json diff --git a/tests/res/multi_load/multi_types/10/40.properties b/tests/res/1/api/multi_load/multi_types/10/40.properties similarity index 100% rename from tests/res/multi_load/multi_types/10/40.properties rename to tests/res/1/api/multi_load/multi_types/10/40.properties diff --git a/tests/res/multi_load/multi_types/10/50.sh b/tests/res/1/api/multi_load/multi_types/10/50.sh similarity index 100% rename from tests/res/multi_load/multi_types/10/50.sh rename to tests/res/1/api/multi_load/multi_types/10/50.sh diff --git a/tests/res/multi_load/multi_types/10/e/exp.json b/tests/res/1/api/multi_load/multi_types/10/e/00.json similarity index 100% rename from tests/res/multi_load/multi_types/10/e/exp.json rename to tests/res/1/api/multi_load/multi_types/10/e/00.json diff --git a/tests/res/multi_load/basics/00/o/00.json b/tests/res/1/api/multi_load/multi_types/10/o/00.json similarity index 100% rename from tests/res/multi_load/basics/00/o/00.json rename to tests/res/1/api/multi_load/multi_types/10/o/00.json diff --git a/tests/res/multi_load/query/00_00/00.json b/tests/res/1/api/multi_load/query/00_00/00.json similarity index 100% rename from tests/res/multi_load/query/00_00/00.json rename to tests/res/1/api/multi_load/query/00_00/00.json diff --git a/tests/res/multi_load/query/00_00/10.json b/tests/res/1/api/multi_load/query/00_00/10.json similarity index 100% rename from tests/res/multi_load/query/00_00/10.json rename to tests/res/1/api/multi_load/query/00_00/10.json diff --git a/tests/res/multi_load/query/00_00/20.json b/tests/res/1/api/multi_load/query/00_00/20.json similarity index 100% rename from tests/res/multi_load/query/00_00/20.json rename to tests/res/1/api/multi_load/query/00_00/20.json diff --git a/tests/res/multi_load/query/00_00/30.json b/tests/res/1/api/multi_load/query/00_00/30.json similarity index 100% rename from tests/res/multi_load/query/00_00/30.json rename to tests/res/1/api/multi_load/query/00_00/30.json diff --git a/tests/res/multi_load/query/00_00/40.json b/tests/res/1/api/multi_load/query/00_00/40.json similarity index 100% rename from tests/res/multi_load/query/00_00/40.json rename to tests/res/1/api/multi_load/query/00_00/40.json diff --git a/tests/res/dicts/get/10/e/20.json b/tests/res/1/api/multi_load/query/00_00/e/00.json similarity index 100% rename from tests/res/dicts/get/10/e/20.json rename to tests/res/1/api/multi_load/query/00_00/e/00.json diff --git a/tests/res/multi_load/multi_types/10/o/00.json b/tests/res/1/api/multi_load/query/00_00/o/00.json similarity index 100% rename from tests/res/multi_load/multi_types/10/o/00.json rename to tests/res/1/api/multi_load/query/00_00/o/00.json diff --git a/tests/res/json/query/q/00_00.txt b/tests/res/1/api/multi_load/query/00_00/q/00.txt similarity index 100% rename from tests/res/json/query/q/00_00.txt rename to tests/res/1/api/multi_load/query/00_00/q/00.txt diff --git a/tests/res/multi_load/query/00_10/00.json b/tests/res/1/api/multi_load/query/00_10/00.json similarity index 100% rename from tests/res/multi_load/query/00_10/00.json rename to tests/res/1/api/multi_load/query/00_10/00.json diff --git a/tests/res/multi_load/query/00_10/10.json b/tests/res/1/api/multi_load/query/00_10/10.json similarity index 100% rename from tests/res/multi_load/query/00_10/10.json rename to tests/res/1/api/multi_load/query/00_10/10.json diff --git a/tests/res/multi_load/query/00_10/20.json b/tests/res/1/api/multi_load/query/00_10/20.json similarity index 100% rename from tests/res/multi_load/query/00_10/20.json rename to tests/res/1/api/multi_load/query/00_10/20.json diff --git a/tests/res/multi_load/query/00_10/30.json b/tests/res/1/api/multi_load/query/00_10/30.json similarity index 100% rename from tests/res/multi_load/query/00_10/30.json rename to tests/res/1/api/multi_load/query/00_10/30.json diff --git a/tests/res/multi_load/query/00_10/40.json b/tests/res/1/api/multi_load/query/00_10/40.json similarity index 100% rename from tests/res/multi_load/query/00_10/40.json rename to tests/res/1/api/multi_load/query/00_10/40.json diff --git a/tests/res/cli/single_input/20/r/10.json b/tests/res/1/api/multi_load/query/00_10/e/00.json similarity index 100% rename from tests/res/cli/single_input/20/r/10.json rename to tests/res/1/api/multi_load/query/00_10/e/00.json diff --git a/tests/res/multi_load/query/00_00/o/00.json b/tests/res/1/api/multi_load/query/00_10/o/00.json similarity index 100% rename from tests/res/multi_load/query/00_00/o/00.json rename to tests/res/1/api/multi_load/query/00_10/o/00.json diff --git a/tests/res/json/primitives/30.json b/tests/res/1/api/multi_load/query/00_10/q/00.txt similarity index 100% rename from tests/res/json/primitives/30.json rename to tests/res/1/api/multi_load/query/00_10/q/00.txt diff --git a/tests/res/multi_load/query/10_10/00.json b/tests/res/1/api/multi_load/query/10_10/00.json similarity index 100% rename from tests/res/multi_load/query/10_10/00.json rename to tests/res/1/api/multi_load/query/10_10/00.json diff --git a/tests/res/multi_load/query/10_10/10.json b/tests/res/1/api/multi_load/query/10_10/10.json similarity index 100% rename from tests/res/multi_load/query/10_10/10.json rename to tests/res/1/api/multi_load/query/10_10/10.json diff --git a/tests/res/multi_load/query/10_10/20.json b/tests/res/1/api/multi_load/query/10_10/20.json similarity index 100% rename from tests/res/multi_load/query/10_10/20.json rename to tests/res/1/api/multi_load/query/10_10/20.json diff --git a/tests/res/multi_load/query/10_10/30.json b/tests/res/1/api/multi_load/query/10_10/30.json similarity index 100% rename from tests/res/multi_load/query/10_10/30.json rename to tests/res/1/api/multi_load/query/10_10/30.json diff --git a/tests/res/multi_load/query/10_10/40.json b/tests/res/1/api/multi_load/query/10_10/40.json similarity index 100% rename from tests/res/multi_load/query/10_10/40.json rename to tests/res/1/api/multi_load/query/10_10/40.json diff --git a/tests/res/dicts/get/20/e/40.py b/tests/res/1/api/multi_load/query/10_10/e/00.json similarity index 100% rename from tests/res/dicts/get/20/e/40.py rename to tests/res/1/api/multi_load/query/10_10/e/00.json diff --git a/tests/res/multi_load/query/00_10/o/00.json b/tests/res/1/api/multi_load/query/10_10/o/00.json similarity index 100% rename from tests/res/multi_load/query/00_10/o/00.json rename to tests/res/1/api/multi_load/query/10_10/o/00.json diff --git a/tests/res/json/primitives/e/30.txt b/tests/res/1/api/multi_load/query/10_10/q/00.txt similarity index 100% rename from tests/res/json/primitives/e/30.txt rename to tests/res/1/api/multi_load/query/10_10/q/00.txt diff --git a/tests/res/multi_load/query/10_20/00.json b/tests/res/1/api/multi_load/query/10_20/00.json similarity index 100% rename from tests/res/multi_load/query/10_20/00.json rename to tests/res/1/api/multi_load/query/10_20/00.json diff --git a/tests/res/multi_load/query/10_20/10.json b/tests/res/1/api/multi_load/query/10_20/10.json similarity index 100% rename from tests/res/multi_load/query/10_20/10.json rename to tests/res/1/api/multi_load/query/10_20/10.json diff --git a/tests/res/multi_load/query/10_20/20.json b/tests/res/1/api/multi_load/query/10_20/20.json similarity index 100% rename from tests/res/multi_load/query/10_20/20.json rename to tests/res/1/api/multi_load/query/10_20/20.json diff --git a/tests/res/multi_load/query/10_20/30.json b/tests/res/1/api/multi_load/query/10_20/30.json similarity index 100% rename from tests/res/multi_load/query/10_20/30.json rename to tests/res/1/api/multi_load/query/10_20/30.json diff --git a/tests/res/multi_load/query/10_20/40.json b/tests/res/1/api/multi_load/query/10_20/40.json similarity index 100% rename from tests/res/multi_load/query/10_20/40.json rename to tests/res/1/api/multi_load/query/10_20/40.json diff --git a/tests/res/multi_load/query/10_20/e/exp.json b/tests/res/1/api/multi_load/query/10_20/e/00.json similarity index 100% rename from tests/res/multi_load/query/10_20/e/exp.json rename to tests/res/1/api/multi_load/query/10_20/e/00.json diff --git a/tests/res/multi_load/query/10_10/o/00.json b/tests/res/1/api/multi_load/query/10_20/o/00.json similarity index 100% rename from tests/res/multi_load/query/10_10/o/00.json rename to tests/res/1/api/multi_load/query/10_20/o/00.json diff --git a/tests/res/json/query/q/10_20.txt b/tests/res/1/api/multi_load/query/10_20/q/00.txt similarity index 100% rename from tests/res/json/query/q/10_20.txt rename to tests/res/1/api/multi_load/query/10_20/q/00.txt diff --git a/tests/res/multi_load/query/10_30/00.json b/tests/res/1/api/multi_load/query/10_30/00.json similarity index 100% rename from tests/res/multi_load/query/10_30/00.json rename to tests/res/1/api/multi_load/query/10_30/00.json diff --git a/tests/res/multi_load/query/10_30/10.json b/tests/res/1/api/multi_load/query/10_30/10.json similarity index 100% rename from tests/res/multi_load/query/10_30/10.json rename to tests/res/1/api/multi_load/query/10_30/10.json diff --git a/tests/res/multi_load/query/10_30/20.json b/tests/res/1/api/multi_load/query/10_30/20.json similarity index 100% rename from tests/res/multi_load/query/10_30/20.json rename to tests/res/1/api/multi_load/query/10_30/20.json diff --git a/tests/res/multi_load/query/10_30/30.json b/tests/res/1/api/multi_load/query/10_30/30.json similarity index 100% rename from tests/res/multi_load/query/10_30/30.json rename to tests/res/1/api/multi_load/query/10_30/30.json diff --git a/tests/res/multi_load/query/10_30/40.json b/tests/res/1/api/multi_load/query/10_30/40.json similarity index 100% rename from tests/res/multi_load/query/10_30/40.json rename to tests/res/1/api/multi_load/query/10_30/40.json diff --git a/tests/res/cli/single_input/20/r/20.json b/tests/res/1/api/multi_load/query/10_30/e/00.json similarity index 100% rename from tests/res/cli/single_input/20/r/20.json rename to tests/res/1/api/multi_load/query/10_30/e/00.json diff --git a/tests/res/multi_load/query/10_20/o/00.json b/tests/res/1/api/multi_load/query/10_30/o/00.json similarity index 100% rename from tests/res/multi_load/query/10_20/o/00.json rename to tests/res/1/api/multi_load/query/10_30/o/00.json diff --git a/tests/res/json/query/q/10_30.txt b/tests/res/1/api/multi_load/query/10_30/q/00.txt similarity index 100% rename from tests/res/json/query/q/10_30.txt rename to tests/res/1/api/multi_load/query/10_30/q/00.txt diff --git a/tests/res/multi_load/query/10_40/00.json b/tests/res/1/api/multi_load/query/10_40/00.json similarity index 100% rename from tests/res/multi_load/query/10_40/00.json rename to tests/res/1/api/multi_load/query/10_40/00.json diff --git a/tests/res/multi_load/query/10_40/10.json b/tests/res/1/api/multi_load/query/10_40/10.json similarity index 100% rename from tests/res/multi_load/query/10_40/10.json rename to tests/res/1/api/multi_load/query/10_40/10.json diff --git a/tests/res/multi_load/query/10_40/20.json b/tests/res/1/api/multi_load/query/10_40/20.json similarity index 100% rename from tests/res/multi_load/query/10_40/20.json rename to tests/res/1/api/multi_load/query/10_40/20.json diff --git a/tests/res/multi_load/query/10_40/30.json b/tests/res/1/api/multi_load/query/10_40/30.json similarity index 100% rename from tests/res/multi_load/query/10_40/30.json rename to tests/res/1/api/multi_load/query/10_40/30.json diff --git a/tests/res/multi_load/query/10_40/40.json b/tests/res/1/api/multi_load/query/10_40/40.json similarity index 100% rename from tests/res/multi_load/query/10_40/40.json rename to tests/res/1/api/multi_load/query/10_40/40.json diff --git a/tests/res/json/query/e/10_40.json b/tests/res/1/api/multi_load/query/10_40/e/00.json similarity index 100% rename from tests/res/json/query/e/10_40.json rename to tests/res/1/api/multi_load/query/10_40/e/00.json diff --git a/tests/res/multi_load/query/10_30/o/00.json b/tests/res/1/api/multi_load/query/10_40/o/00.json similarity index 100% rename from tests/res/multi_load/query/10_30/o/00.json rename to tests/res/1/api/multi_load/query/10_40/o/00.json diff --git a/tests/res/json/query/q/10_40.txt b/tests/res/1/api/multi_load/query/10_40/q/00.txt similarity index 100% rename from tests/res/json/query/q/10_40.txt rename to tests/res/1/api/multi_load/query/10_40/q/00.txt diff --git a/tests/res/multi_load/query/10_50/00.json b/tests/res/1/api/multi_load/query/10_50/00.json similarity index 100% rename from tests/res/multi_load/query/10_50/00.json rename to tests/res/1/api/multi_load/query/10_50/00.json diff --git a/tests/res/multi_load/query/10_50/10.json b/tests/res/1/api/multi_load/query/10_50/10.json similarity index 100% rename from tests/res/multi_load/query/10_50/10.json rename to tests/res/1/api/multi_load/query/10_50/10.json diff --git a/tests/res/multi_load/query/10_50/20.json b/tests/res/1/api/multi_load/query/10_50/20.json similarity index 100% rename from tests/res/multi_load/query/10_50/20.json rename to tests/res/1/api/multi_load/query/10_50/20.json diff --git a/tests/res/multi_load/query/10_50/30.json b/tests/res/1/api/multi_load/query/10_50/30.json similarity index 100% rename from tests/res/multi_load/query/10_50/30.json rename to tests/res/1/api/multi_load/query/10_50/30.json diff --git a/tests/res/multi_load/query/10_50/40.json b/tests/res/1/api/multi_load/query/10_50/40.json similarity index 100% rename from tests/res/multi_load/query/10_50/40.json rename to tests/res/1/api/multi_load/query/10_50/40.json diff --git a/tests/res/dicts/mk_nested_dic/10/q/10.py b/tests/res/1/api/multi_load/query/10_50/e/00.json similarity index 100% rename from tests/res/dicts/mk_nested_dic/10/q/10.py rename to tests/res/1/api/multi_load/query/10_50/e/00.json diff --git a/tests/res/multi_load/query/10_40/o/00.json b/tests/res/1/api/multi_load/query/10_50/o/00.json similarity index 100% rename from tests/res/multi_load/query/10_40/o/00.json rename to tests/res/1/api/multi_load/query/10_50/o/00.json diff --git a/tests/res/json/query/q/10_50.txt b/tests/res/1/api/multi_load/query/10_50/q/00.txt similarity index 100% rename from tests/res/json/query/q/10_50.txt rename to tests/res/1/api/multi_load/query/10_50/q/00.txt diff --git a/tests/res/multi_load/query/20_00/00.json b/tests/res/1/api/multi_load/query/20_00/00.json similarity index 100% rename from tests/res/multi_load/query/20_00/00.json rename to tests/res/1/api/multi_load/query/20_00/00.json diff --git a/tests/res/multi_load/query/20_00/10.json b/tests/res/1/api/multi_load/query/20_00/10.json similarity index 100% rename from tests/res/multi_load/query/20_00/10.json rename to tests/res/1/api/multi_load/query/20_00/10.json diff --git a/tests/res/multi_load/query/20_00/20.json b/tests/res/1/api/multi_load/query/20_00/20.json similarity index 100% rename from tests/res/multi_load/query/20_00/20.json rename to tests/res/1/api/multi_load/query/20_00/20.json diff --git a/tests/res/multi_load/query/20_00/30.json b/tests/res/1/api/multi_load/query/20_00/30.json similarity index 100% rename from tests/res/multi_load/query/20_00/30.json rename to tests/res/1/api/multi_load/query/20_00/30.json diff --git a/tests/res/multi_load/query/20_00/40.json b/tests/res/1/api/multi_load/query/20_00/40.json similarity index 100% rename from tests/res/multi_load/query/20_00/40.json rename to tests/res/1/api/multi_load/query/20_00/40.json diff --git a/tests/res/dicts/get/30/e/20.json b/tests/res/1/api/multi_load/query/20_00/e/00.json similarity index 100% rename from tests/res/dicts/get/30/e/20.json rename to tests/res/1/api/multi_load/query/20_00/e/00.json diff --git a/tests/res/multi_load/query/10_50/o/00.json b/tests/res/1/api/multi_load/query/20_00/o/00.json similarity index 100% rename from tests/res/multi_load/query/10_50/o/00.json rename to tests/res/1/api/multi_load/query/20_00/o/00.json diff --git a/tests/res/single_load/query/10/q/00_00.txt b/tests/res/1/api/multi_load/query/20_00/q/00.txt similarity index 100% rename from tests/res/single_load/query/10/q/00_00.txt rename to tests/res/1/api/multi_load/query/20_00/q/00.txt diff --git a/tests/res/multi_load/query/20_10/00.json b/tests/res/1/api/multi_load/query/20_10/00.json similarity index 100% rename from tests/res/multi_load/query/20_10/00.json rename to tests/res/1/api/multi_load/query/20_10/00.json diff --git a/tests/res/multi_load/query/20_10/10.json b/tests/res/1/api/multi_load/query/20_10/10.json similarity index 100% rename from tests/res/multi_load/query/20_10/10.json rename to tests/res/1/api/multi_load/query/20_10/10.json diff --git a/tests/res/multi_load/query/20_10/20.json b/tests/res/1/api/multi_load/query/20_10/20.json similarity index 100% rename from tests/res/multi_load/query/20_10/20.json rename to tests/res/1/api/multi_load/query/20_10/20.json diff --git a/tests/res/multi_load/query/20_10/30.json b/tests/res/1/api/multi_load/query/20_10/30.json similarity index 100% rename from tests/res/multi_load/query/20_10/30.json rename to tests/res/1/api/multi_load/query/20_10/30.json diff --git a/tests/res/multi_load/query/20_10/40.json b/tests/res/1/api/multi_load/query/20_10/40.json similarity index 100% rename from tests/res/multi_load/query/20_10/40.json rename to tests/res/1/api/multi_load/query/20_10/40.json diff --git a/tests/res/json/primitives/20.json b/tests/res/1/api/multi_load/query/20_10/e/00.json similarity index 100% rename from tests/res/json/primitives/20.json rename to tests/res/1/api/multi_load/query/20_10/e/00.json diff --git a/tests/res/multi_load/query/20_00/o/00.json b/tests/res/1/api/multi_load/query/20_10/o/00.json similarity index 100% rename from tests/res/multi_load/query/20_00/o/00.json rename to tests/res/1/api/multi_load/query/20_10/o/00.json diff --git a/tests/res/json/query/q/20_10.txt b/tests/res/1/api/multi_load/query/20_10/q/00.txt similarity index 100% rename from tests/res/json/query/q/20_10.txt rename to tests/res/1/api/multi_load/query/20_10/q/00.txt diff --git a/tests/res/multi_load/query/20_20/00.json b/tests/res/1/api/multi_load/query/20_20/00.json similarity index 100% rename from tests/res/multi_load/query/20_20/00.json rename to tests/res/1/api/multi_load/query/20_20/00.json diff --git a/tests/res/multi_load/query/20_20/10.json b/tests/res/1/api/multi_load/query/20_20/10.json similarity index 100% rename from tests/res/multi_load/query/20_20/10.json rename to tests/res/1/api/multi_load/query/20_20/10.json diff --git a/tests/res/multi_load/query/20_20/20.json b/tests/res/1/api/multi_load/query/20_20/20.json similarity index 100% rename from tests/res/multi_load/query/20_20/20.json rename to tests/res/1/api/multi_load/query/20_20/20.json diff --git a/tests/res/multi_load/query/20_20/30.json b/tests/res/1/api/multi_load/query/20_20/30.json similarity index 100% rename from tests/res/multi_load/query/20_20/30.json rename to tests/res/1/api/multi_load/query/20_20/30.json diff --git a/tests/res/multi_load/query/20_20/40.json b/tests/res/1/api/multi_load/query/20_20/40.json similarity index 100% rename from tests/res/multi_load/query/20_20/40.json rename to tests/res/1/api/multi_load/query/20_20/40.json diff --git a/tests/res/dicts/get/30/e/30.json b/tests/res/1/api/multi_load/query/20_20/e/00.json similarity index 100% rename from tests/res/dicts/get/30/e/30.json rename to tests/res/1/api/multi_load/query/20_20/e/00.json diff --git a/tests/res/multi_load/query/20_10/o/00.json b/tests/res/1/api/multi_load/query/20_20/o/00.json similarity index 100% rename from tests/res/multi_load/query/20_10/o/00.json rename to tests/res/1/api/multi_load/query/20_20/o/00.json diff --git a/tests/res/json/query/q/20_20.txt b/tests/res/1/api/multi_load/query/20_20/q/00.txt similarity index 100% rename from tests/res/json/query/q/20_20.txt rename to tests/res/1/api/multi_load/query/20_20/q/00.txt diff --git a/tests/res/multi_load/basics/00/00.json b/tests/res/1/api/multi_load/schema/00/00.json similarity index 100% rename from tests/res/multi_load/basics/00/00.json rename to tests/res/1/api/multi_load/schema/00/00.json diff --git a/tests/res/multi_load/schema/00/10.json b/tests/res/1/api/multi_load/schema/00/10.json similarity index 100% rename from tests/res/multi_load/schema/00/10.json rename to tests/res/1/api/multi_load/schema/00/10.json diff --git a/tests/res/multi_load/schema/00/20.json b/tests/res/1/api/multi_load/schema/00/20.json similarity index 100% rename from tests/res/multi_load/schema/00/20.json rename to tests/res/1/api/multi_load/schema/00/20.json diff --git a/tests/res/multi_load/schema/00/30.json b/tests/res/1/api/multi_load/schema/00/30.json similarity index 100% rename from tests/res/multi_load/schema/00/30.json rename to tests/res/1/api/multi_load/schema/00/30.json diff --git a/tests/res/multi_load/schema/00/40.json b/tests/res/1/api/multi_load/schema/00/40.json similarity index 100% rename from tests/res/multi_load/schema/00/40.json rename to tests/res/1/api/multi_load/schema/00/40.json diff --git a/tests/res/multi_load/basics/00/e/exp.json b/tests/res/1/api/multi_load/schema/00/e/00.json similarity index 100% rename from tests/res/multi_load/basics/00/e/exp.json rename to tests/res/1/api/multi_load/schema/00/e/00.json diff --git a/tests/res/multi_load/query/20_20/o/00.json b/tests/res/1/api/multi_load/schema/00/o/00.json similarity index 100% rename from tests/res/multi_load/query/20_20/o/00.json rename to tests/res/1/api/multi_load/schema/00/o/00.json diff --git a/tests/res/json/basic/schema/20.json b/tests/res/1/api/multi_load/schema/00/s/00.json similarity index 100% rename from tests/res/json/basic/schema/20.json rename to tests/res/1/api/multi_load/schema/00/s/00.json diff --git a/tests/res/multi_load/template/00/00.json b/tests/res/1/api/multi_load/template/00/00.json similarity index 100% rename from tests/res/multi_load/template/00/00.json rename to tests/res/1/api/multi_load/template/00/00.json diff --git a/tests/res/multi_load/template/00/30.json b/tests/res/1/api/multi_load/template/00/30.json similarity index 100% rename from tests/res/multi_load/template/00/30.json rename to tests/res/1/api/multi_load/template/00/30.json diff --git a/tests/res/multi_load/template/00/c/00.json b/tests/res/1/api/multi_load/template/00/c/00.json similarity index 100% rename from tests/res/multi_load/template/00/c/00.json rename to tests/res/1/api/multi_load/template/00/c/00.json diff --git a/tests/res/multi_load/template/00/e/exp.json b/tests/res/1/api/multi_load/template/00/e/00.json similarity index 100% rename from tests/res/multi_load/template/00/e/exp.json rename to tests/res/1/api/multi_load/template/00/e/00.json diff --git a/tests/res/multi_load/template/00/o/00.json b/tests/res/1/api/multi_load/template/00/o/00.json similarity index 100% rename from tests/res/multi_load/template/00/o/00.json rename to tests/res/1/api/multi_load/template/00/o/00.json diff --git a/tests/res/json/template/00.json b/tests/res/1/api/multi_load/template/10/00.json similarity index 100% rename from tests/res/json/template/00.json rename to tests/res/1/api/multi_load/template/10/00.json diff --git a/tests/res/multi_load/template/10/10.json b/tests/res/1/api/multi_load/template/10/10.json similarity index 100% rename from tests/res/multi_load/template/10/10.json rename to tests/res/1/api/multi_load/template/10/10.json diff --git a/tests/res/multi_load/template/10/20.json b/tests/res/1/api/multi_load/template/10/20.json similarity index 100% rename from tests/res/multi_load/template/10/20.json rename to tests/res/1/api/multi_load/template/10/20.json diff --git a/tests/res/multi_load/template/10/30.json b/tests/res/1/api/multi_load/template/10/30.json similarity index 100% rename from tests/res/multi_load/template/10/30.json rename to tests/res/1/api/multi_load/template/10/30.json diff --git a/tests/res/multi_load/template/10/c/00.json b/tests/res/1/api/multi_load/template/10/c/00.json similarity index 100% rename from tests/res/multi_load/template/10/c/00.json rename to tests/res/1/api/multi_load/template/10/c/00.json diff --git a/tests/res/multi_load/schema/00/e/exp.json b/tests/res/1/api/multi_load/template/10/e/00.json similarity index 100% rename from tests/res/multi_load/schema/00/e/exp.json rename to tests/res/1/api/multi_load/template/10/e/00.json diff --git a/tests/res/multi_load/template/10/o/00.json b/tests/res/1/api/multi_load/template/10/o/00.json similarity index 100% rename from tests/res/multi_load/template/10/o/00.json rename to tests/res/1/api/multi_load/template/10/o/00.json diff --git a/tests/res/multi_load/template/20/00.json b/tests/res/1/api/multi_load/template/20/00.json similarity index 100% rename from tests/res/multi_load/template/20/00.json rename to tests/res/1/api/multi_load/template/20/00.json diff --git a/tests/res/multi_load/template/20/10.json b/tests/res/1/api/multi_load/template/20/10.json similarity index 100% rename from tests/res/multi_load/template/20/10.json rename to tests/res/1/api/multi_load/template/20/10.json diff --git a/tests/res/multi_load/template/20/20.json b/tests/res/1/api/multi_load/template/20/20.json similarity index 100% rename from tests/res/multi_load/template/20/20.json rename to tests/res/1/api/multi_load/template/20/20.json diff --git a/tests/res/multi_load/template/20/30.json b/tests/res/1/api/multi_load/template/20/30.json similarity index 100% rename from tests/res/multi_load/template/20/30.json rename to tests/res/1/api/multi_load/template/20/30.json diff --git a/tests/res/multi_load/template/20/e/exp.json b/tests/res/1/api/multi_load/template/20/e/00.json similarity index 100% rename from tests/res/multi_load/template/20/e/exp.json rename to tests/res/1/api/multi_load/template/20/e/00.json diff --git a/tests/res/multi_load/template/20/o b/tests/res/1/api/multi_load/template/20/o similarity index 100% rename from tests/res/multi_load/template/20/o rename to tests/res/1/api/multi_load/template/20/o diff --git a/tests/res/1/api/open/basics b/tests/res/1/api/open/basics new file mode 120000 index 00000000..5c0d3053 --- /dev/null +++ b/tests/res/1/api/open/basics @@ -0,0 +1 @@ +../single_load/basics \ No newline at end of file diff --git a/tests/res/single_load/ac_parser/10/00.conf b/tests/res/1/api/single_load/ac_parser/10/00.conf similarity index 100% rename from tests/res/single_load/ac_parser/10/00.conf rename to tests/res/1/api/single_load/ac_parser/10/00.conf diff --git a/tests/res/single_load/ac_parser/10/10.conf b/tests/res/1/api/single_load/ac_parser/10/10.conf similarity index 100% rename from tests/res/single_load/ac_parser/10/10.conf rename to tests/res/1/api/single_load/ac_parser/10/10.conf diff --git a/tests/res/single_load/ac_parser/10/20.conf b/tests/res/1/api/single_load/ac_parser/10/20.conf similarity index 100% rename from tests/res/single_load/ac_parser/10/20.conf rename to tests/res/1/api/single_load/ac_parser/10/20.conf diff --git a/tests/res/single_load/ac_parser/10/e b/tests/res/1/api/single_load/ac_parser/10/e similarity index 100% rename from tests/res/single_load/ac_parser/10/e rename to tests/res/1/api/single_load/ac_parser/10/e diff --git a/tests/res/single_load/ac_parser/10/o/00.json b/tests/res/1/api/single_load/ac_parser/10/o/00.json similarity index 100% rename from tests/res/single_load/ac_parser/10/o/00.json rename to tests/res/1/api/single_load/ac_parser/10/o/00.json diff --git a/tests/res/dumps/basics/20/o/10.json b/tests/res/1/api/single_load/ac_parser/10/o/10.json similarity index 100% rename from tests/res/dumps/basics/20/o/10.json rename to tests/res/1/api/single_load/ac_parser/10/o/10.json diff --git a/tests/res/dumps/basics/20/o/20.json b/tests/res/1/api/single_load/ac_parser/10/o/20.json similarity index 100% rename from tests/res/dumps/basics/20/o/20.json rename to tests/res/1/api/single_load/ac_parser/10/o/20.json diff --git a/tests/res/multi_load/schema/00/00.json b/tests/res/1/api/single_load/basics/10/00.json similarity index 100% rename from tests/res/multi_load/schema/00/00.json rename to tests/res/1/api/single_load/basics/10/00.json diff --git a/tests/res/json/basic/10.json b/tests/res/1/api/single_load/basics/10/10.json similarity index 100% rename from tests/res/json/basic/10.json rename to tests/res/1/api/single_load/basics/10/10.json diff --git a/tests/res/single_load/basics/10/20.json b/tests/res/1/api/single_load/basics/10/20.json similarity index 100% rename from tests/res/single_load/basics/10/20.json rename to tests/res/1/api/single_load/basics/10/20.json diff --git a/tests/res/single_load/basics/10/e/00.py b/tests/res/1/api/single_load/basics/10/e/00.py similarity index 100% rename from tests/res/single_load/basics/10/e/00.py rename to tests/res/1/api/single_load/basics/10/e/00.py diff --git a/tests/res/single_load/basics/10/e/10.py b/tests/res/1/api/single_load/basics/10/e/10.py similarity index 100% rename from tests/res/single_load/basics/10/e/10.py rename to tests/res/1/api/single_load/basics/10/e/10.py diff --git a/tests/res/single_load/basics/10/e/20.py b/tests/res/1/api/single_load/basics/10/e/20.py similarity index 100% rename from tests/res/single_load/basics/10/e/20.py rename to tests/res/1/api/single_load/basics/10/e/20.py diff --git a/tests/res/single_load/basics/20/00.json b/tests/res/1/api/single_load/basics/20/00.json similarity index 100% rename from tests/res/single_load/basics/20/00.json rename to tests/res/1/api/single_load/basics/20/00.json diff --git a/tests/res/cli/single_input/20/10.json b/tests/res/1/api/single_load/basics/20/10.json similarity index 100% rename from tests/res/cli/single_input/20/10.json rename to tests/res/1/api/single_load/basics/20/10.json diff --git a/tests/res/single_load/basics/20/20.json b/tests/res/1/api/single_load/basics/20/20.json similarity index 100% rename from tests/res/single_load/basics/20/20.json rename to tests/res/1/api/single_load/basics/20/20.json diff --git a/tests/res/dicts/get/20/e/00.json b/tests/res/1/api/single_load/basics/20/e/00.json similarity index 100% rename from tests/res/dicts/get/20/e/00.json rename to tests/res/1/api/single_load/basics/20/e/00.json diff --git a/tests/res/cli/show/10/o/10.json b/tests/res/1/api/single_load/basics/20/e/10.json similarity index 100% rename from tests/res/cli/show/10/o/10.json rename to tests/res/1/api/single_load/basics/20/e/10.json diff --git a/tests/res/cli/show/10/o/20.json b/tests/res/1/api/single_load/basics/20/e/20.json similarity index 100% rename from tests/res/cli/show/10/o/20.json rename to tests/res/1/api/single_load/basics/20/e/20.json diff --git a/tests/res/single_load/basics/30/00.json b/tests/res/1/api/single_load/basics/30/00.json similarity index 100% rename from tests/res/single_load/basics/30/00.json rename to tests/res/1/api/single_load/basics/30/00.json diff --git a/tests/res/cli/single_input/30/10.json b/tests/res/1/api/single_load/basics/30/10.json similarity index 100% rename from tests/res/cli/single_input/30/10.json rename to tests/res/1/api/single_load/basics/30/10.json diff --git a/tests/res/single_load/basics/30/20.json b/tests/res/1/api/single_load/basics/30/20.json similarity index 100% rename from tests/res/single_load/basics/30/20.json rename to tests/res/1/api/single_load/basics/30/20.json diff --git a/tests/res/single_load/basics/20/e/00.json b/tests/res/1/api/single_load/basics/30/e/00.json similarity index 100% rename from tests/res/single_load/basics/20/e/00.json rename to tests/res/1/api/single_load/basics/30/e/00.json diff --git a/tests/res/cli/show/20/o/10.json b/tests/res/1/api/single_load/basics/30/e/10.json similarity index 100% rename from tests/res/cli/show/20/o/10.json rename to tests/res/1/api/single_load/basics/30/e/10.json diff --git a/tests/res/cli/show/20/o/20.json b/tests/res/1/api/single_load/basics/30/e/20.json similarity index 100% rename from tests/res/cli/show/20/o/20.json rename to tests/res/1/api/single_load/basics/30/e/20.json diff --git a/tests/res/single_load/basics/30/o/00.json b/tests/res/1/api/single_load/basics/30/o/00.json similarity index 100% rename from tests/res/single_load/basics/30/o/00.json rename to tests/res/1/api/single_load/basics/30/o/00.json diff --git a/tests/res/loads/basics/10/o/10.json b/tests/res/1/api/single_load/basics/30/o/10.json similarity index 100% rename from tests/res/loads/basics/10/o/10.json rename to tests/res/1/api/single_load/basics/30/o/10.json diff --git a/tests/res/loads/basics/10/o/20.json b/tests/res/1/api/single_load/basics/30/o/20.json similarity index 100% rename from tests/res/loads/basics/10/o/20.json rename to tests/res/1/api/single_load/basics/30/o/20.json diff --git a/tests/res/single_load/multi_types/10/10.ini b/tests/res/1/api/single_load/multi_types/10/10.ini similarity index 100% rename from tests/res/single_load/multi_types/10/10.ini rename to tests/res/1/api/single_load/multi_types/10/10.ini diff --git a/tests/res/single_load/multi_types/10/20.properties b/tests/res/1/api/single_load/multi_types/10/20.properties similarity index 100% rename from tests/res/single_load/multi_types/10/20.properties rename to tests/res/1/api/single_load/multi_types/10/20.properties diff --git a/tests/res/single_load/multi_types/10/e/10.json b/tests/res/1/api/single_load/multi_types/10/e/10.json similarity index 100% rename from tests/res/single_load/multi_types/10/e/10.json rename to tests/res/1/api/single_load/multi_types/10/e/10.json diff --git a/tests/res/single_load/multi_types/10/e/20.json b/tests/res/1/api/single_load/multi_types/10/e/20.json similarity index 100% rename from tests/res/single_load/multi_types/10/e/20.json rename to tests/res/1/api/single_load/multi_types/10/e/20.json diff --git a/tests/res/shellvars/10.sh b/tests/res/1/api/single_load/multi_types/20/10.sh similarity index 100% rename from tests/res/shellvars/10.sh rename to tests/res/1/api/single_load/multi_types/20/10.sh diff --git a/tests/res/shellvars/e/10.json b/tests/res/1/api/single_load/multi_types/20/e/10.json similarity index 100% rename from tests/res/shellvars/e/10.json rename to tests/res/1/api/single_load/multi_types/20/e/10.json diff --git a/tests/res/single_load/multi_types/20/o/10.json b/tests/res/1/api/single_load/multi_types/20/o/10.json similarity index 100% rename from tests/res/single_load/multi_types/20/o/10.json rename to tests/res/1/api/single_load/multi_types/20/o/10.json diff --git a/tests/res/single_load/multi_types/30/00.xml b/tests/res/1/api/single_load/multi_types/30/00.xml similarity index 100% rename from tests/res/single_load/multi_types/30/00.xml rename to tests/res/1/api/single_load/multi_types/30/00.xml diff --git a/tests/res/single_load/multi_types/30/10.xml b/tests/res/1/api/single_load/multi_types/30/10.xml similarity index 100% rename from tests/res/single_load/multi_types/30/10.xml rename to tests/res/1/api/single_load/multi_types/30/10.xml diff --git a/tests/res/single_load/multi_types/30/20.xml b/tests/res/1/api/single_load/multi_types/30/20.xml similarity index 100% rename from tests/res/single_load/multi_types/30/20.xml rename to tests/res/1/api/single_load/multi_types/30/20.xml diff --git a/tests/res/single_load/multi_types/30/e/00.json b/tests/res/1/api/single_load/multi_types/30/e/00.json similarity index 100% rename from tests/res/single_load/multi_types/30/e/00.json rename to tests/res/1/api/single_load/multi_types/30/e/00.json diff --git a/tests/res/single_load/multi_types/30/e/10.json b/tests/res/1/api/single_load/multi_types/30/e/10.json similarity index 100% rename from tests/res/single_load/multi_types/30/e/10.json rename to tests/res/1/api/single_load/multi_types/30/e/10.json diff --git a/tests/res/single_load/multi_types/30/e/20.json b/tests/res/1/api/single_load/multi_types/30/e/20.json similarity index 100% rename from tests/res/single_load/multi_types/30/e/20.json rename to tests/res/1/api/single_load/multi_types/30/e/20.json diff --git a/tests/res/json/primitives/10.json b/tests/res/1/api/single_load/primitives/10/10.json similarity index 100% rename from tests/res/json/primitives/10.json rename to tests/res/1/api/single_load/primitives/10/10.json diff --git a/tests/res/single_load/primitives/10/20.json b/tests/res/1/api/single_load/primitives/10/20.json similarity index 100% rename from tests/res/single_load/primitives/10/20.json rename to tests/res/1/api/single_load/primitives/10/20.json diff --git a/tests/res/single_load/primitives/10/30.json b/tests/res/1/api/single_load/primitives/10/30.json similarity index 100% rename from tests/res/single_load/primitives/10/30.json rename to tests/res/1/api/single_load/primitives/10/30.json diff --git a/tests/res/json/primitives/40.json b/tests/res/1/api/single_load/primitives/10/40.json similarity index 100% rename from tests/res/json/primitives/40.json rename to tests/res/1/api/single_load/primitives/10/40.json diff --git a/tests/res/single_load/primitives/10/e/10.py b/tests/res/1/api/single_load/primitives/10/e/10.py similarity index 100% rename from tests/res/single_load/primitives/10/e/10.py rename to tests/res/1/api/single_load/primitives/10/e/10.py diff --git a/tests/res/single_load/primitives/10/e/20.py b/tests/res/1/api/single_load/primitives/10/e/20.py similarity index 100% rename from tests/res/single_load/primitives/10/e/20.py rename to tests/res/1/api/single_load/primitives/10/e/20.py diff --git a/tests/res/single_load/primitives/10/e/30.py b/tests/res/1/api/single_load/primitives/10/e/30.py similarity index 100% rename from tests/res/single_load/primitives/10/e/30.py rename to tests/res/1/api/single_load/primitives/10/e/30.py diff --git a/tests/res/single_load/primitives/10/e/40.py b/tests/res/1/api/single_load/primitives/10/e/40.py similarity index 100% rename from tests/res/single_load/primitives/10/e/40.py rename to tests/res/1/api/single_load/primitives/10/e/40.py diff --git a/tests/res/single_load/query/10/00_00.json b/tests/res/1/api/single_load/query/10/00_00.json similarity index 100% rename from tests/res/single_load/query/10/00_00.json rename to tests/res/1/api/single_load/query/10/00_00.json diff --git a/tests/res/single_load/query/10/00_10.json b/tests/res/1/api/single_load/query/10/00_10.json similarity index 100% rename from tests/res/single_load/query/10/00_10.json rename to tests/res/1/api/single_load/query/10/00_10.json diff --git a/tests/res/single_load/query/10/10_00.json b/tests/res/1/api/single_load/query/10/10_00.json similarity index 100% rename from tests/res/single_load/query/10/10_00.json rename to tests/res/1/api/single_load/query/10/10_00.json diff --git a/tests/res/single_load/query/10/10_10.json b/tests/res/1/api/single_load/query/10/10_10.json similarity index 100% rename from tests/res/single_load/query/10/10_10.json rename to tests/res/1/api/single_load/query/10/10_10.json diff --git a/tests/res/single_load/query/10/10_20.json b/tests/res/1/api/single_load/query/10/10_20.json similarity index 100% rename from tests/res/single_load/query/10/10_20.json rename to tests/res/1/api/single_load/query/10/10_20.json diff --git a/tests/res/single_load/query/10/10_30.json b/tests/res/1/api/single_load/query/10/10_30.json similarity index 100% rename from tests/res/single_load/query/10/10_30.json rename to tests/res/1/api/single_load/query/10/10_30.json diff --git a/tests/res/single_load/schema/10/10.json b/tests/res/1/api/single_load/query/10/10_40.json similarity index 100% rename from tests/res/single_load/schema/10/10.json rename to tests/res/1/api/single_load/query/10/10_40.json diff --git a/tests/res/1/api/single_load/query/10/10_50.json b/tests/res/1/api/single_load/query/10/10_50.json new file mode 120000 index 00000000..8da49fea --- /dev/null +++ b/tests/res/1/api/single_load/query/10/10_50.json @@ -0,0 +1 @@ +../../basics/10/10.json \ No newline at end of file diff --git a/tests/res/single_load/query/10/20_00.json b/tests/res/1/api/single_load/query/10/20_00.json similarity index 100% rename from tests/res/single_load/query/10/20_00.json rename to tests/res/1/api/single_load/query/10/20_00.json diff --git a/tests/res/single_load/query/10/20_10.json b/tests/res/1/api/single_load/query/10/20_10.json similarity index 100% rename from tests/res/single_load/query/10/20_10.json rename to tests/res/1/api/single_load/query/10/20_10.json diff --git a/tests/res/single_load/query/10/20_20.json b/tests/res/1/api/single_load/query/10/20_20.json similarity index 100% rename from tests/res/single_load/query/10/20_20.json rename to tests/res/1/api/single_load/query/10/20_20.json diff --git a/tests/res/json/query/e/00_00.json b/tests/res/1/api/single_load/query/10/e/00_00.json similarity index 100% rename from tests/res/json/query/e/00_00.json rename to tests/res/1/api/single_load/query/10/e/00_00.json diff --git a/tests/res/json/query/e/00_10.json b/tests/res/1/api/single_load/query/10/e/00_10.json similarity index 100% rename from tests/res/json/query/e/00_10.json rename to tests/res/1/api/single_load/query/10/e/00_10.json diff --git a/tests/res/loads/query/10/o/10_00.json b/tests/res/1/api/single_load/query/10/e/10_00.json similarity index 100% rename from tests/res/loads/query/10/o/10_00.json rename to tests/res/1/api/single_load/query/10/e/10_00.json diff --git a/tests/res/json/query/e/10_10.json b/tests/res/1/api/single_load/query/10/e/10_10.json similarity index 100% rename from tests/res/json/query/e/10_10.json rename to tests/res/1/api/single_load/query/10/e/10_10.json diff --git a/tests/res/json/query/e/10_20.json b/tests/res/1/api/single_load/query/10/e/10_20.json similarity index 100% rename from tests/res/json/query/e/10_20.json rename to tests/res/1/api/single_load/query/10/e/10_20.json diff --git a/tests/res/json/query/e/10_30.json b/tests/res/1/api/single_load/query/10/e/10_30.json similarity index 100% rename from tests/res/json/query/e/10_30.json rename to tests/res/1/api/single_load/query/10/e/10_30.json diff --git a/tests/res/single_load/query/10/e/10_40.json b/tests/res/1/api/single_load/query/10/e/10_40.json similarity index 100% rename from tests/res/single_load/query/10/e/10_40.json rename to tests/res/1/api/single_load/query/10/e/10_40.json diff --git a/tests/res/json/query/e/10_50.json b/tests/res/1/api/single_load/query/10/e/10_50.json similarity index 100% rename from tests/res/json/query/e/10_50.json rename to tests/res/1/api/single_load/query/10/e/10_50.json diff --git a/tests/res/single_load/query/10/e/20_00.json b/tests/res/1/api/single_load/query/10/e/20_00.json similarity index 100% rename from tests/res/single_load/query/10/e/20_00.json rename to tests/res/1/api/single_load/query/10/e/20_00.json diff --git a/tests/res/json/query/e/20_10.json b/tests/res/1/api/single_load/query/10/e/20_10.json similarity index 100% rename from tests/res/json/query/e/20_10.json rename to tests/res/1/api/single_load/query/10/e/20_10.json diff --git a/tests/res/json/query/e/20_20.json b/tests/res/1/api/single_load/query/10/e/20_20.json similarity index 100% rename from tests/res/json/query/e/20_20.json rename to tests/res/1/api/single_load/query/10/e/20_20.json diff --git a/tests/res/1/api/single_load/query/10/q/00_00.txt b/tests/res/1/api/single_load/query/10/q/00_00.txt new file mode 100644 index 00000000..c9599b95 --- /dev/null +++ b/tests/res/1/api/single_load/query/10/q/00_00.txt @@ -0,0 +1 @@ +"z" diff --git a/tests/res/json/query/q/00_10.txt b/tests/res/1/api/single_load/query/10/q/00_10.txt similarity index 100% rename from tests/res/json/query/q/00_10.txt rename to tests/res/1/api/single_load/query/10/q/00_10.txt diff --git a/tests/res/json/query/q/10_00.txt b/tests/res/1/api/single_load/query/10/q/10_00.txt similarity index 100% rename from tests/res/json/query/q/10_00.txt rename to tests/res/1/api/single_load/query/10/q/10_00.txt diff --git a/tests/res/json/query/q/10_10.txt b/tests/res/1/api/single_load/query/10/q/10_10.txt similarity index 100% rename from tests/res/json/query/q/10_10.txt rename to tests/res/1/api/single_load/query/10/q/10_10.txt diff --git a/tests/res/single_load/query/10/q/10_20.txt b/tests/res/1/api/single_load/query/10/q/10_20.txt similarity index 100% rename from tests/res/single_load/query/10/q/10_20.txt rename to tests/res/1/api/single_load/query/10/q/10_20.txt diff --git a/tests/res/single_load/query/10/q/10_30.txt b/tests/res/1/api/single_load/query/10/q/10_30.txt similarity index 100% rename from tests/res/single_load/query/10/q/10_30.txt rename to tests/res/1/api/single_load/query/10/q/10_30.txt diff --git a/tests/res/single_load/query/10/q/10_40.txt b/tests/res/1/api/single_load/query/10/q/10_40.txt similarity index 100% rename from tests/res/single_load/query/10/q/10_40.txt rename to tests/res/1/api/single_load/query/10/q/10_40.txt diff --git a/tests/res/single_load/query/10/q/10_50.txt b/tests/res/1/api/single_load/query/10/q/10_50.txt similarity index 100% rename from tests/res/single_load/query/10/q/10_50.txt rename to tests/res/1/api/single_load/query/10/q/10_50.txt diff --git a/tests/res/json/query/q/20_00.txt b/tests/res/1/api/single_load/query/10/q/20_00.txt similarity index 100% rename from tests/res/json/query/q/20_00.txt rename to tests/res/1/api/single_load/query/10/q/20_00.txt diff --git a/tests/res/single_load/query/10/q/20_10.txt b/tests/res/1/api/single_load/query/10/q/20_10.txt similarity index 100% rename from tests/res/single_load/query/10/q/20_10.txt rename to tests/res/1/api/single_load/query/10/q/20_10.txt diff --git a/tests/res/single_load/query/10/q/20_20.txt b/tests/res/1/api/single_load/query/10/q/20_20.txt similarity index 100% rename from tests/res/single_load/query/10/q/20_20.txt rename to tests/res/1/api/single_load/query/10/q/20_20.txt diff --git a/tests/res/single_load/schema/10/00.json b/tests/res/1/api/single_load/schema/10/00.json similarity index 100% rename from tests/res/single_load/schema/10/00.json rename to tests/res/1/api/single_load/schema/10/00.json diff --git a/tests/res/1/api/single_load/schema/10/10.json b/tests/res/1/api/single_load/schema/10/10.json new file mode 120000 index 00000000..8da49fea --- /dev/null +++ b/tests/res/1/api/single_load/schema/10/10.json @@ -0,0 +1 @@ +../../basics/10/10.json \ No newline at end of file diff --git a/tests/res/single_load/schema/10/20.json b/tests/res/1/api/single_load/schema/10/20.json similarity index 100% rename from tests/res/single_load/schema/10/20.json rename to tests/res/1/api/single_load/schema/10/20.json diff --git a/tests/res/single_load/schema/10/e b/tests/res/1/api/single_load/schema/10/e similarity index 100% rename from tests/res/single_load/schema/10/e rename to tests/res/1/api/single_load/schema/10/e diff --git a/tests/res/json/basic/schema/00.json b/tests/res/1/api/single_load/schema/10/s/00.json similarity index 100% rename from tests/res/json/basic/schema/00.json rename to tests/res/1/api/single_load/schema/10/s/00.json diff --git a/tests/res/json/basic/schema/10.json b/tests/res/1/api/single_load/schema/10/s/10.json similarity index 100% rename from tests/res/json/basic/schema/10.json rename to tests/res/1/api/single_load/schema/10/s/10.json diff --git a/tests/res/single_load/schema/10/s/20.json b/tests/res/1/api/single_load/schema/10/s/20.json similarity index 100% rename from tests/res/single_load/schema/10/s/20.json rename to tests/res/1/api/single_load/schema/10/s/20.json diff --git a/tests/res/single_load/template/00/00.j2 b/tests/res/1/api/single_load/template/00/00.j2 similarity index 100% rename from tests/res/single_load/template/00/00.j2 rename to tests/res/1/api/single_load/template/00/00.j2 diff --git a/tests/res/single_load/template/00/10.j2 b/tests/res/1/api/single_load/template/00/10.j2 similarity index 100% rename from tests/res/single_load/template/00/10.j2 rename to tests/res/1/api/single_load/template/00/10.j2 diff --git a/tests/res/single_load/template/00/20.j2 b/tests/res/1/api/single_load/template/00/20.j2 similarity index 100% rename from tests/res/single_load/template/00/20.j2 rename to tests/res/1/api/single_load/template/00/20.j2 diff --git a/tests/res/single_load/template/00/c/00.json b/tests/res/1/api/single_load/template/00/c/00.json similarity index 100% rename from tests/res/single_load/template/00/c/00.json rename to tests/res/1/api/single_load/template/00/c/00.json diff --git a/tests/res/single_load/template/00/c/10.json b/tests/res/1/api/single_load/template/00/c/10.json similarity index 100% rename from tests/res/single_load/template/00/c/10.json rename to tests/res/1/api/single_load/template/00/c/10.json diff --git a/tests/res/single_load/template/00/c/20.json b/tests/res/1/api/single_load/template/00/c/20.json similarity index 100% rename from tests/res/single_load/template/00/c/20.json rename to tests/res/1/api/single_load/template/00/c/20.json diff --git a/tests/res/single_load/template/00/e/00.json b/tests/res/1/api/single_load/template/00/e/00.json similarity index 100% rename from tests/res/single_load/template/00/e/00.json rename to tests/res/1/api/single_load/template/00/e/00.json diff --git a/tests/res/single_load/template/00/e/10.json b/tests/res/1/api/single_load/template/00/e/10.json similarity index 100% rename from tests/res/single_load/template/00/e/10.json rename to tests/res/1/api/single_load/template/00/e/10.json diff --git a/tests/res/single_load/template/00/e/20.json b/tests/res/1/api/single_load/template/00/e/20.json similarity index 100% rename from tests/res/single_load/template/00/e/20.json rename to tests/res/1/api/single_load/template/00/e/20.json diff --git a/tests/res/single_load/template/00/o/00.json b/tests/res/1/api/single_load/template/00/o/00.json similarity index 100% rename from tests/res/single_load/template/00/o/00.json rename to tests/res/1/api/single_load/template/00/o/00.json diff --git a/tests/res/loads/template/10/o/10.json b/tests/res/1/api/single_load/template/00/o/10.json similarity index 100% rename from tests/res/loads/template/10/o/10.json rename to tests/res/1/api/single_load/template/00/o/10.json diff --git a/tests/res/loads/template/10/o/20.json b/tests/res/1/api/single_load/template/00/o/20.json similarity index 100% rename from tests/res/loads/template/10/o/20.json rename to tests/res/1/api/single_load/template/00/o/20.json diff --git a/tests/res/single_load/template/10/00.j2 b/tests/res/1/api/single_load/template/10/00.j2 similarity index 100% rename from tests/res/single_load/template/10/00.j2 rename to tests/res/1/api/single_load/template/10/00.j2 diff --git a/tests/res/single_load/template/10/10.j2 b/tests/res/1/api/single_load/template/10/10.j2 similarity index 100% rename from tests/res/single_load/template/10/10.j2 rename to tests/res/1/api/single_load/template/10/10.j2 diff --git a/tests/res/single_load/template/10/20.j2 b/tests/res/1/api/single_load/template/10/20.j2 similarity index 100% rename from tests/res/single_load/template/10/20.j2 rename to tests/res/1/api/single_load/template/10/20.j2 diff --git a/tests/res/single_load/template/10/30.j2 b/tests/res/1/api/single_load/template/10/30.j2 similarity index 100% rename from tests/res/single_load/template/10/30.j2 rename to tests/res/1/api/single_load/template/10/30.j2 diff --git a/tests/res/single_load/template/10/c/00.json b/tests/res/1/api/single_load/template/10/c/00.json similarity index 100% rename from tests/res/single_load/template/10/c/00.json rename to tests/res/1/api/single_load/template/10/c/00.json diff --git a/tests/res/single_load/template/10/c/10.json b/tests/res/1/api/single_load/template/10/c/10.json similarity index 100% rename from tests/res/single_load/template/10/c/10.json rename to tests/res/1/api/single_load/template/10/c/10.json diff --git a/tests/res/single_load/template/10/c/20.json b/tests/res/1/api/single_load/template/10/c/20.json similarity index 100% rename from tests/res/single_load/template/10/c/20.json rename to tests/res/1/api/single_load/template/10/c/20.json diff --git a/tests/res/single_load/template/10/c/30.json b/tests/res/1/api/single_load/template/10/c/30.json similarity index 100% rename from tests/res/single_load/template/10/c/30.json rename to tests/res/1/api/single_load/template/10/c/30.json diff --git a/tests/res/single_load/template/10/e/00.json b/tests/res/1/api/single_load/template/10/e/00.json similarity index 100% rename from tests/res/single_load/template/10/e/00.json rename to tests/res/1/api/single_load/template/10/e/00.json diff --git a/tests/res/single_load/template/10/e/10.json b/tests/res/1/api/single_load/template/10/e/10.json similarity index 100% rename from tests/res/single_load/template/10/e/10.json rename to tests/res/1/api/single_load/template/10/e/10.json diff --git a/tests/res/cli/multi_inputs/10/20.json b/tests/res/1/api/single_load/template/10/e/20.json similarity index 100% rename from tests/res/cli/multi_inputs/10/20.json rename to tests/res/1/api/single_load/template/10/e/20.json diff --git a/tests/res/parser/list/10/o/30.json b/tests/res/1/api/single_load/template/10/e/30.json similarity index 100% rename from tests/res/parser/list/10/o/30.json rename to tests/res/1/api/single_load/template/10/e/30.json diff --git a/tests/res/single_load/template/10/o/00.json b/tests/res/1/api/single_load/template/10/o/00.json similarity index 100% rename from tests/res/single_load/template/10/o/00.json rename to tests/res/1/api/single_load/template/10/o/00.json diff --git a/tests/res/parser/list/10/o/10.json b/tests/res/1/api/single_load/template/10/o/10.json similarity index 100% rename from tests/res/parser/list/10/o/10.json rename to tests/res/1/api/single_load/template/10/o/10.json diff --git a/tests/res/parser/list/10/o/20.json b/tests/res/1/api/single_load/template/10/o/20.json similarity index 100% rename from tests/res/parser/list/10/o/20.json rename to tests/res/1/api/single_load/template/10/o/20.json diff --git a/tests/res/single_load/template/10/e/30.json b/tests/res/1/api/single_load/template/10/o/30.json similarity index 100% rename from tests/res/single_load/template/10/e/30.json rename to tests/res/1/api/single_load/template/10/o/30.json diff --git a/tests/res/single_load/template/20/00.j2 b/tests/res/1/api/single_load/template/20/00.j2 similarity index 100% rename from tests/res/single_load/template/20/00.j2 rename to tests/res/1/api/single_load/template/20/00.j2 diff --git a/tests/res/single_load/template/20/10.j2 b/tests/res/1/api/single_load/template/20/10.j2 similarity index 100% rename from tests/res/single_load/template/20/10.j2 rename to tests/res/1/api/single_load/template/20/10.j2 diff --git a/tests/res/single_load/template/20/20.j2 b/tests/res/1/api/single_load/template/20/20.j2 similarity index 100% rename from tests/res/single_load/template/20/20.j2 rename to tests/res/1/api/single_load/template/20/20.j2 diff --git a/tests/res/single_load/template/20/c/00.json b/tests/res/1/api/single_load/template/20/c/00.json similarity index 100% rename from tests/res/single_load/template/20/c/00.json rename to tests/res/1/api/single_load/template/20/c/00.json diff --git a/tests/res/single_load/template/20/c/10.json b/tests/res/1/api/single_load/template/20/c/10.json similarity index 100% rename from tests/res/single_load/template/20/c/10.json rename to tests/res/1/api/single_load/template/20/c/10.json diff --git a/tests/res/single_load/template/20/c/20.json b/tests/res/1/api/single_load/template/20/c/20.json similarity index 100% rename from tests/res/single_load/template/20/c/20.json rename to tests/res/1/api/single_load/template/20/c/20.json diff --git a/tests/res/single_load/template/20/e b/tests/res/1/api/single_load/template/20/e similarity index 100% rename from tests/res/single_load/template/20/e rename to tests/res/1/api/single_load/template/20/e diff --git a/tests/res/single_load/template/20/o/00.json b/tests/res/1/api/single_load/template/20/o/00.json similarity index 100% rename from tests/res/single_load/template/20/o/00.json rename to tests/res/1/api/single_load/template/20/o/00.json diff --git a/tests/res/single_load/ac_parser/10/o/10.json b/tests/res/1/api/single_load/template/20/o/10.json similarity index 100% rename from tests/res/single_load/ac_parser/10/o/10.json rename to tests/res/1/api/single_load/template/20/o/10.json diff --git a/tests/res/single_load/ac_parser/10/o/20.json b/tests/res/1/api/single_load/template/20/o/20.json similarity index 100% rename from tests/res/single_load/ac_parser/10/o/20.json rename to tests/res/1/api/single_load/template/20/o/20.json diff --git a/tests/res/single_load/toml/10/00.toml b/tests/res/1/api/single_load/toml/10/00.toml similarity index 100% rename from tests/res/single_load/toml/10/00.toml rename to tests/res/1/api/single_load/toml/10/00.toml diff --git a/tests/res/single_load/toml/10/10.toml b/tests/res/1/api/single_load/toml/10/10.toml similarity index 100% rename from tests/res/single_load/toml/10/10.toml rename to tests/res/1/api/single_load/toml/10/10.toml diff --git a/tests/res/single_load/toml/10/20.toml b/tests/res/1/api/single_load/toml/10/20.toml similarity index 100% rename from tests/res/single_load/toml/10/20.toml rename to tests/res/1/api/single_load/toml/10/20.toml diff --git a/tests/res/single_load/basics/10/00.json b/tests/res/1/api/single_load/toml/10/e/00.json similarity index 100% rename from tests/res/single_load/basics/10/00.json rename to tests/res/1/api/single_load/toml/10/e/00.json diff --git a/tests/res/single_load/basics/10/10.json b/tests/res/1/api/single_load/toml/10/e/10.json similarity index 100% rename from tests/res/single_load/basics/10/10.json rename to tests/res/1/api/single_load/toml/10/e/10.json diff --git a/tests/res/single_load/toml/10/e/20.json b/tests/res/1/api/single_load/toml/10/e/20.json similarity index 100% rename from tests/res/single_load/toml/10/e/20.json rename to tests/res/1/api/single_load/toml/10/e/20.json diff --git a/tests/res/single_load/yaml/10/00.yml b/tests/res/1/api/single_load/yaml/10/00.yml similarity index 100% rename from tests/res/single_load/yaml/10/00.yml rename to tests/res/1/api/single_load/yaml/10/00.yml diff --git a/tests/res/single_load/yaml/10/10.yml b/tests/res/1/api/single_load/yaml/10/10.yml similarity index 100% rename from tests/res/single_load/yaml/10/10.yml rename to tests/res/1/api/single_load/yaml/10/10.yml diff --git a/tests/res/single_load/yaml/10/20.yml b/tests/res/1/api/single_load/yaml/10/20.yml similarity index 100% rename from tests/res/single_load/yaml/10/20.yml rename to tests/res/1/api/single_load/yaml/10/20.yml diff --git a/tests/res/single_load/toml/10/e/00.json b/tests/res/1/api/single_load/yaml/10/e/00.json similarity index 100% rename from tests/res/single_load/toml/10/e/00.json rename to tests/res/1/api/single_load/yaml/10/e/00.json diff --git a/tests/res/single_load/toml/10/e/10.json b/tests/res/1/api/single_load/yaml/10/e/10.json similarity index 100% rename from tests/res/single_load/toml/10/e/10.json rename to tests/res/1/api/single_load/yaml/10/e/10.json diff --git a/tests/res/single_load/yaml/10/e/20.json b/tests/res/1/api/single_load/yaml/10/e/20.json similarity index 100% rename from tests/res/single_load/yaml/10/e/20.json rename to tests/res/1/api/single_load/yaml/10/e/20.json diff --git a/tests/res/cli/basics/10/10.json b/tests/res/1/cli/basics/10/10.json similarity index 100% rename from tests/res/cli/basics/10/10.json rename to tests/res/1/cli/basics/10/10.json diff --git a/tests/res/cli/basics/10/e/10.json b/tests/res/1/cli/basics/10/e/10.json similarity index 100% rename from tests/res/cli/basics/10/e/10.json rename to tests/res/1/cli/basics/10/e/10.json diff --git a/tests/res/cli/basics/10/o/10.json b/tests/res/1/cli/basics/10/o/10.json similarity index 100% rename from tests/res/cli/basics/10/o/10.json rename to tests/res/1/cli/basics/10/o/10.json diff --git a/tests/res/cli/errors/10/10.json b/tests/res/1/cli/errors/10/10.json similarity index 100% rename from tests/res/cli/errors/10/10.json rename to tests/res/1/cli/errors/10/10.json diff --git a/tests/res/cli/errors/10/20.json b/tests/res/1/cli/errors/10/20.json similarity index 100% rename from tests/res/cli/errors/10/20.json rename to tests/res/1/cli/errors/10/20.json diff --git a/tests/res/cli/errors/10/30.json b/tests/res/1/cli/errors/10/30.json similarity index 100% rename from tests/res/cli/errors/10/30.json rename to tests/res/1/cli/errors/10/30.json diff --git a/tests/res/cli/errors/10/40.json b/tests/res/1/cli/errors/10/40.json similarity index 100% rename from tests/res/cli/errors/10/40.json rename to tests/res/1/cli/errors/10/40.json diff --git a/tests/res/cli/errors/10/50.json b/tests/res/1/cli/errors/10/50.json similarity index 100% rename from tests/res/cli/errors/10/50.json rename to tests/res/1/cli/errors/10/50.json diff --git a/tests/res/cli/errors/10/e/10.json b/tests/res/1/cli/errors/10/e/10.json similarity index 100% rename from tests/res/cli/errors/10/e/10.json rename to tests/res/1/cli/errors/10/e/10.json diff --git a/tests/res/cli/errors/10/e/20.json b/tests/res/1/cli/errors/10/e/20.json similarity index 100% rename from tests/res/cli/errors/10/e/20.json rename to tests/res/1/cli/errors/10/e/20.json diff --git a/tests/res/cli/errors/10/e/30.json b/tests/res/1/cli/errors/10/e/30.json similarity index 100% rename from tests/res/cli/errors/10/e/30.json rename to tests/res/1/cli/errors/10/e/30.json diff --git a/tests/res/cli/errors/10/e/40.json b/tests/res/1/cli/errors/10/e/40.json similarity index 100% rename from tests/res/cli/errors/10/e/40.json rename to tests/res/1/cli/errors/10/e/40.json diff --git a/tests/res/cli/errors/10/e/50.json b/tests/res/1/cli/errors/10/e/50.json similarity index 100% rename from tests/res/cli/errors/10/e/50.json rename to tests/res/1/cli/errors/10/e/50.json diff --git a/tests/res/cli/errors/10/o/10.json b/tests/res/1/cli/errors/10/o/10.json similarity index 100% rename from tests/res/cli/errors/10/o/10.json rename to tests/res/1/cli/errors/10/o/10.json diff --git a/tests/res/cli/errors/10/o/20.json b/tests/res/1/cli/errors/10/o/20.json similarity index 100% rename from tests/res/cli/errors/10/o/20.json rename to tests/res/1/cli/errors/10/o/20.json diff --git a/tests/res/cli/errors/10/o/30.json b/tests/res/1/cli/errors/10/o/30.json similarity index 100% rename from tests/res/cli/errors/10/o/30.json rename to tests/res/1/cli/errors/10/o/30.json diff --git a/tests/res/cli/errors/10/o/40.json b/tests/res/1/cli/errors/10/o/40.json similarity index 100% rename from tests/res/cli/errors/10/o/40.json rename to tests/res/1/cli/errors/10/o/40.json diff --git a/tests/res/cli/errors/10/o/50.json b/tests/res/1/cli/errors/10/o/50.json similarity index 100% rename from tests/res/cli/errors/10/o/50.json rename to tests/res/1/cli/errors/10/o/50.json diff --git a/tests/res/cli/extra_options/10/10.json b/tests/res/1/cli/extra_options/10/10.json similarity index 100% rename from tests/res/cli/extra_options/10/10.json rename to tests/res/1/cli/extra_options/10/10.json diff --git a/tests/res/cli/extra_options/10/e/10.json b/tests/res/1/cli/extra_options/10/e/10.json similarity index 100% rename from tests/res/cli/extra_options/10/e/10.json rename to tests/res/1/cli/extra_options/10/e/10.json diff --git a/tests/res/cli/extra_options/10/o/10.json b/tests/res/1/cli/extra_options/10/o/10.json similarity index 100% rename from tests/res/cli/extra_options/10/o/10.json rename to tests/res/1/cli/extra_options/10/o/10.json diff --git a/tests/res/cli/extra_options/10/on/10.json b/tests/res/1/cli/extra_options/10/on/10.json similarity index 100% rename from tests/res/cli/extra_options/10/on/10.json rename to tests/res/1/cli/extra_options/10/on/10.json diff --git a/tests/res/cli/extra_options/10/r/10.json b/tests/res/1/cli/extra_options/10/r/10.json similarity index 100% rename from tests/res/cli/extra_options/10/r/10.json rename to tests/res/1/cli/extra_options/10/r/10.json diff --git a/tests/res/cli/ignore_missing/10/10.json b/tests/res/1/cli/ignore_missing/10/10.json similarity index 100% rename from tests/res/cli/ignore_missing/10/10.json rename to tests/res/1/cli/ignore_missing/10/10.json diff --git a/tests/res/cli/ignore_missing/10/e/10.json b/tests/res/1/cli/ignore_missing/10/e/10.json similarity index 100% rename from tests/res/cli/ignore_missing/10/e/10.json rename to tests/res/1/cli/ignore_missing/10/e/10.json diff --git a/tests/res/cli/ignore_missing/10/o/10.json b/tests/res/1/cli/ignore_missing/10/o/10.json similarity index 100% rename from tests/res/cli/ignore_missing/10/o/10.json rename to tests/res/1/cli/ignore_missing/10/o/10.json diff --git a/tests/res/cli/ignore_missing/10/on/10.json b/tests/res/1/cli/ignore_missing/10/on/10.json similarity index 100% rename from tests/res/cli/ignore_missing/10/on/10.json rename to tests/res/1/cli/ignore_missing/10/on/10.json diff --git a/tests/res/cli/ignore_missing/10/r/10.json b/tests/res/1/cli/ignore_missing/10/r/10.json similarity index 100% rename from tests/res/cli/ignore_missing/10/r/10.json rename to tests/res/1/cli/ignore_missing/10/r/10.json diff --git a/tests/res/cli/multi_inputs/10/10.json b/tests/res/1/cli/multi_inputs/10/10.json similarity index 100% rename from tests/res/cli/multi_inputs/10/10.json rename to tests/res/1/cli/multi_inputs/10/10.json diff --git a/tests/res/single_load/template/10/e/20.json b/tests/res/1/cli/multi_inputs/10/20.json similarity index 100% rename from tests/res/single_load/template/10/e/20.json rename to tests/res/1/cli/multi_inputs/10/20.json diff --git a/tests/res/cli/multi_inputs/10/30.json b/tests/res/1/cli/multi_inputs/10/30.json similarity index 100% rename from tests/res/cli/multi_inputs/10/30.json rename to tests/res/1/cli/multi_inputs/10/30.json diff --git a/tests/res/cli/multi_inputs/10/e/10.json b/tests/res/1/cli/multi_inputs/10/e/10.json similarity index 100% rename from tests/res/cli/multi_inputs/10/e/10.json rename to tests/res/1/cli/multi_inputs/10/e/10.json diff --git a/tests/res/cli/multi_inputs/10/o/10.json b/tests/res/1/cli/multi_inputs/10/o/10.json similarity index 100% rename from tests/res/cli/multi_inputs/10/o/10.json rename to tests/res/1/cli/multi_inputs/10/o/10.json diff --git a/tests/res/cli/multi_inputs/10/on/10.json b/tests/res/1/cli/multi_inputs/10/on/10.json similarity index 100% rename from tests/res/cli/multi_inputs/10/on/10.json rename to tests/res/1/cli/multi_inputs/10/on/10.json diff --git a/tests/res/cli/multi_inputs/10/r/10.json b/tests/res/1/cli/multi_inputs/10/r/10.json similarity index 100% rename from tests/res/cli/multi_inputs/10/r/10.json rename to tests/res/1/cli/multi_inputs/10/r/10.json diff --git a/tests/res/cli/multi_inputs/20/10.json b/tests/res/1/cli/multi_inputs/20/10.json similarity index 100% rename from tests/res/cli/multi_inputs/20/10.json rename to tests/res/1/cli/multi_inputs/20/10.json diff --git a/tests/res/cli/multi_inputs/20/20.xml b/tests/res/1/cli/multi_inputs/20/20.xml similarity index 100% rename from tests/res/cli/multi_inputs/20/20.xml rename to tests/res/1/cli/multi_inputs/20/20.xml diff --git a/tests/res/cli/multi_inputs/20/30.sh b/tests/res/1/cli/multi_inputs/20/30.sh similarity index 100% rename from tests/res/cli/multi_inputs/20/30.sh rename to tests/res/1/cli/multi_inputs/20/30.sh diff --git a/tests/res/cli/multi_inputs/20/e/10.json b/tests/res/1/cli/multi_inputs/20/e/10.json similarity index 100% rename from tests/res/cli/multi_inputs/20/e/10.json rename to tests/res/1/cli/multi_inputs/20/e/10.json diff --git a/tests/res/cli/multi_inputs/20/o/10.json b/tests/res/1/cli/multi_inputs/20/o/10.json similarity index 100% rename from tests/res/cli/multi_inputs/20/o/10.json rename to tests/res/1/cli/multi_inputs/20/o/10.json diff --git a/tests/res/cli/multi_inputs/20/on/10.json b/tests/res/1/cli/multi_inputs/20/on/10.json similarity index 100% rename from tests/res/cli/multi_inputs/20/on/10.json rename to tests/res/1/cli/multi_inputs/20/on/10.json diff --git a/tests/res/cli/multi_inputs/20/r/10.json b/tests/res/1/cli/multi_inputs/20/r/10.json similarity index 100% rename from tests/res/cli/multi_inputs/20/r/10.json rename to tests/res/1/cli/multi_inputs/20/r/10.json diff --git a/tests/res/cli/no_template/10/10.json b/tests/res/1/cli/no_template/10/10.json similarity index 100% rename from tests/res/cli/no_template/10/10.json rename to tests/res/1/cli/no_template/10/10.json diff --git a/tests/res/cli/no_template/10/o/10.json b/tests/res/1/cli/no_template/10/o/10.json similarity index 100% rename from tests/res/cli/no_template/10/o/10.json rename to tests/res/1/cli/no_template/10/o/10.json diff --git a/tests/res/cli/no_template/10/on/10.json b/tests/res/1/cli/no_template/10/on/10.json similarity index 100% rename from tests/res/cli/no_template/10/on/10.json rename to tests/res/1/cli/no_template/10/on/10.json diff --git a/tests/res/cli/no_template/10/r/10.json b/tests/res/1/cli/no_template/10/r/10.json similarity index 100% rename from tests/res/cli/no_template/10/r/10.json rename to tests/res/1/cli/no_template/10/r/10.json diff --git a/tests/res/cli/query/10/10.json b/tests/res/1/cli/query/10/10.json similarity index 100% rename from tests/res/cli/query/10/10.json rename to tests/res/1/cli/query/10/10.json diff --git a/tests/res/cli/query/10/e/10.json b/tests/res/1/cli/query/10/e/10.json similarity index 100% rename from tests/res/cli/query/10/e/10.json rename to tests/res/1/cli/query/10/e/10.json diff --git a/tests/res/cli/query/10/o/10.json b/tests/res/1/cli/query/10/o/10.json similarity index 100% rename from tests/res/cli/query/10/o/10.json rename to tests/res/1/cli/query/10/o/10.json diff --git a/tests/res/cli/query/10/on/10.json b/tests/res/1/cli/query/10/on/10.json similarity index 100% rename from tests/res/cli/query/10/on/10.json rename to tests/res/1/cli/query/10/on/10.json diff --git a/tests/res/cli/query/10/r/10.json b/tests/res/1/cli/query/10/r/10.json similarity index 100% rename from tests/res/cli/query/10/r/10.json rename to tests/res/1/cli/query/10/r/10.json diff --git a/tests/res/1/cli/schema/10/00.json b/tests/res/1/cli/schema/10/00.json new file mode 120000 index 00000000..688fedec --- /dev/null +++ b/tests/res/1/cli/schema/10/00.json @@ -0,0 +1 @@ +../../../api/single_load/schema/10/00.json \ No newline at end of file diff --git a/tests/res/1/cli/schema/10/10.json b/tests/res/1/cli/schema/10/10.json new file mode 120000 index 00000000..040d3dfb --- /dev/null +++ b/tests/res/1/cli/schema/10/10.json @@ -0,0 +1 @@ +../../../api/single_load/schema/10/10.json \ No newline at end of file diff --git a/tests/res/1/cli/schema/10/20.json b/tests/res/1/cli/schema/10/20.json new file mode 120000 index 00000000..8417604b --- /dev/null +++ b/tests/res/1/cli/schema/10/20.json @@ -0,0 +1 @@ +../../../api/single_load/schema/10/20.json \ No newline at end of file diff --git a/tests/res/cli/schema/10/e/10.json b/tests/res/1/cli/schema/10/e/00.json similarity index 100% rename from tests/res/cli/schema/10/e/10.json rename to tests/res/1/cli/schema/10/e/00.json diff --git a/tests/res/single_load/basics/30/o/10.json b/tests/res/1/cli/schema/10/e/10.json similarity index 100% rename from tests/res/single_load/basics/30/o/10.json rename to tests/res/1/cli/schema/10/e/10.json diff --git a/tests/res/single_load/basics/30/o/20.json b/tests/res/1/cli/schema/10/e/20.json similarity index 100% rename from tests/res/single_load/basics/30/o/20.json rename to tests/res/1/cli/schema/10/e/20.json diff --git a/tests/res/cli/schema_errors/10/o/10.json b/tests/res/1/cli/schema/10/o/00.json similarity index 100% rename from tests/res/cli/schema_errors/10/o/10.json rename to tests/res/1/cli/schema/10/o/00.json diff --git a/tests/res/single_load/template/00/o/10.json b/tests/res/1/cli/schema/10/o/10.json similarity index 100% rename from tests/res/single_load/template/00/o/10.json rename to tests/res/1/cli/schema/10/o/10.json diff --git a/tests/res/single_load/template/00/o/20.json b/tests/res/1/cli/schema/10/o/20.json similarity index 100% rename from tests/res/single_load/template/00/o/20.json rename to tests/res/1/cli/schema/10/o/20.json diff --git a/tests/res/cli/single_input/10/30.json b/tests/res/1/cli/schema/10/o/30.json similarity index 100% rename from tests/res/cli/single_input/10/30.json rename to tests/res/1/cli/schema/10/o/30.json diff --git a/tests/res/1/cli/schema/10/s b/tests/res/1/cli/schema/10/s new file mode 120000 index 00000000..ef553143 --- /dev/null +++ b/tests/res/1/cli/schema/10/s @@ -0,0 +1 @@ +../../../api/single_load/schema/10/s \ No newline at end of file diff --git a/tests/res/cli/schema_errors/10/10.json b/tests/res/1/cli/schema_errors/10/10.json similarity index 100% rename from tests/res/cli/schema_errors/10/10.json rename to tests/res/1/cli/schema_errors/10/10.json diff --git a/tests/res/cli/schema_errors/10/e/10.json b/tests/res/1/cli/schema_errors/10/e/10.json similarity index 100% rename from tests/res/cli/schema_errors/10/e/10.json rename to tests/res/1/cli/schema_errors/10/e/10.json diff --git a/tests/res/1/cli/schema_errors/10/o/10.json b/tests/res/1/cli/schema_errors/10/o/10.json new file mode 100644 index 00000000..99a359a0 --- /dev/null +++ b/tests/res/1/cli/schema_errors/10/o/10.json @@ -0,0 +1 @@ +["--validate"] diff --git a/tests/res/cli/show/10/10.json b/tests/res/1/cli/show/10/10.json similarity index 100% rename from tests/res/cli/show/10/10.json rename to tests/res/1/cli/show/10/10.json diff --git a/tests/res/cli/show/10/20.json b/tests/res/1/cli/show/10/20.json similarity index 100% rename from tests/res/cli/show/10/20.json rename to tests/res/1/cli/show/10/20.json diff --git a/tests/res/cli/show/10/30.json b/tests/res/1/cli/show/10/30.json similarity index 100% rename from tests/res/cli/show/10/30.json rename to tests/res/1/cli/show/10/30.json diff --git a/tests/res/cli/show/10/40.json b/tests/res/1/cli/show/10/40.json similarity index 100% rename from tests/res/cli/show/10/40.json rename to tests/res/1/cli/show/10/40.json diff --git a/tests/res/cli/show/10/e/10.json b/tests/res/1/cli/show/10/e/10.json similarity index 100% rename from tests/res/cli/show/10/e/10.json rename to tests/res/1/cli/show/10/e/10.json diff --git a/tests/res/cli/show/10/e/20.json b/tests/res/1/cli/show/10/e/20.json similarity index 100% rename from tests/res/cli/show/10/e/20.json rename to tests/res/1/cli/show/10/e/20.json diff --git a/tests/res/cli/show/10/e/30.json b/tests/res/1/cli/show/10/e/30.json similarity index 100% rename from tests/res/cli/show/10/e/30.json rename to tests/res/1/cli/show/10/e/30.json diff --git a/tests/res/cli/show/10/e/40.json b/tests/res/1/cli/show/10/e/40.json similarity index 100% rename from tests/res/cli/show/10/e/40.json rename to tests/res/1/cli/show/10/e/40.json diff --git a/tests/res/cli/show_version/10/o/10.json b/tests/res/1/cli/show/10/o/10.json similarity index 100% rename from tests/res/cli/show_version/10/o/10.json rename to tests/res/1/cli/show/10/o/10.json diff --git a/tests/res/single_load/basics/20/e/20.json b/tests/res/1/cli/show/10/o/20.json similarity index 100% rename from tests/res/single_load/basics/20/e/20.json rename to tests/res/1/cli/show/10/o/20.json diff --git a/tests/res/cli/show/10/o/30.json b/tests/res/1/cli/show/10/o/30.json similarity index 100% rename from tests/res/cli/show/10/o/30.json rename to tests/res/1/cli/show/10/o/30.json diff --git a/tests/res/cli/show/10/o/40.json b/tests/res/1/cli/show/10/o/40.json similarity index 100% rename from tests/res/cli/show/10/o/40.json rename to tests/res/1/cli/show/10/o/40.json diff --git a/tests/res/cli/show/20/10.json b/tests/res/1/cli/show/20/10.json similarity index 100% rename from tests/res/cli/show/20/10.json rename to tests/res/1/cli/show/20/10.json diff --git a/tests/res/cli/show/20/20.json b/tests/res/1/cli/show/20/20.json similarity index 100% rename from tests/res/cli/show/20/20.json rename to tests/res/1/cli/show/20/20.json diff --git a/tests/res/cli/show/20/e/10.json b/tests/res/1/cli/show/20/e/10.json similarity index 100% rename from tests/res/cli/show/20/e/10.json rename to tests/res/1/cli/show/20/e/10.json diff --git a/tests/res/cli/show/20/e/20.json b/tests/res/1/cli/show/20/e/20.json similarity index 100% rename from tests/res/cli/show/20/e/20.json rename to tests/res/1/cli/show/20/e/20.json diff --git a/tests/res/cli/single_input/10/r/10.json b/tests/res/1/cli/show/20/o/10.json similarity index 100% rename from tests/res/cli/single_input/10/r/10.json rename to tests/res/1/cli/show/20/o/10.json diff --git a/tests/res/single_load/basics/30/e/20.json b/tests/res/1/cli/show/20/o/20.json similarity index 100% rename from tests/res/single_load/basics/30/e/20.json rename to tests/res/1/cli/show/20/o/20.json diff --git a/tests/res/cli/show_version/10/10.json b/tests/res/1/cli/show_version/10/10.json similarity index 100% rename from tests/res/cli/show_version/10/10.json rename to tests/res/1/cli/show_version/10/10.json diff --git a/tests/res/cli/show_version/10/e/10.json b/tests/res/1/cli/show_version/10/e/10.json similarity index 100% rename from tests/res/cli/show_version/10/e/10.json rename to tests/res/1/cli/show_version/10/e/10.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/r/10.json b/tests/res/1/cli/show_version/10/o/10.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/r/10.json rename to tests/res/1/cli/show_version/10/o/10.json diff --git a/tests/res/cli/single_input/10/10.json b/tests/res/1/cli/single_input/10/10.json similarity index 100% rename from tests/res/cli/single_input/10/10.json rename to tests/res/1/cli/single_input/10/10.json diff --git a/tests/res/cli/single_input/10/20.conf b/tests/res/1/cli/single_input/10/20.conf similarity index 100% rename from tests/res/cli/single_input/10/20.conf rename to tests/res/1/cli/single_input/10/20.conf diff --git a/tests/res/cli/single_input/10/e/30.json b/tests/res/1/cli/single_input/10/30.json similarity index 100% rename from tests/res/cli/single_input/10/e/30.json rename to tests/res/1/cli/single_input/10/30.json diff --git a/tests/res/cli/single_input/10/e/10.json b/tests/res/1/cli/single_input/10/e/10.json similarity index 100% rename from tests/res/cli/single_input/10/e/10.json rename to tests/res/1/cli/single_input/10/e/10.json diff --git a/tests/res/cli/schema/10/20.json b/tests/res/1/cli/single_input/10/e/20.json similarity index 100% rename from tests/res/cli/schema/10/20.json rename to tests/res/1/cli/single_input/10/e/20.json diff --git a/tests/res/cli/single_input/10/r/30.json b/tests/res/1/cli/single_input/10/e/30.json similarity index 100% rename from tests/res/cli/single_input/10/r/30.json rename to tests/res/1/cli/single_input/10/e/30.json diff --git a/tests/res/cli/single_input/10/o/10.json b/tests/res/1/cli/single_input/10/o/10.json similarity index 100% rename from tests/res/cli/single_input/10/o/10.json rename to tests/res/1/cli/single_input/10/o/10.json diff --git a/tests/res/cli/single_input/10/o/20.json b/tests/res/1/cli/single_input/10/o/20.json similarity index 100% rename from tests/res/cli/single_input/10/o/20.json rename to tests/res/1/cli/single_input/10/o/20.json diff --git a/tests/res/cli/single_input/10/o/30.json b/tests/res/1/cli/single_input/10/o/30.json similarity index 100% rename from tests/res/cli/single_input/10/o/30.json rename to tests/res/1/cli/single_input/10/o/30.json diff --git a/tests/res/cli/single_input/10/on/10.json b/tests/res/1/cli/single_input/10/on/10.json similarity index 100% rename from tests/res/cli/single_input/10/on/10.json rename to tests/res/1/cli/single_input/10/on/10.json diff --git a/tests/res/cli/single_input/10/e/20.json b/tests/res/1/cli/single_input/10/on/20.json similarity index 100% rename from tests/res/cli/single_input/10/e/20.json rename to tests/res/1/cli/single_input/10/on/20.json diff --git a/tests/res/cli/single_input/10/on/30.json b/tests/res/1/cli/single_input/10/on/30.json similarity index 100% rename from tests/res/cli/single_input/10/on/30.json rename to tests/res/1/cli/single_input/10/on/30.json diff --git a/tests/res/cli/single_input/10/oo/10.json b/tests/res/1/cli/single_input/10/oo/10.json similarity index 100% rename from tests/res/cli/single_input/10/oo/10.json rename to tests/res/1/cli/single_input/10/oo/10.json diff --git a/tests/res/cli/single_input/10/on/20.json b/tests/res/1/cli/single_input/10/oo/20.json similarity index 100% rename from tests/res/cli/single_input/10/on/20.json rename to tests/res/1/cli/single_input/10/oo/20.json diff --git a/tests/res/cli/single_input/10/oo/30.json b/tests/res/1/cli/single_input/10/oo/30.json similarity index 100% rename from tests/res/cli/single_input/10/oo/30.json rename to tests/res/1/cli/single_input/10/oo/30.json diff --git a/tests/res/dicts/get/10/e/10.json b/tests/res/1/cli/single_input/10/r/10.json similarity index 100% rename from tests/res/dicts/get/10/e/10.json rename to tests/res/1/cli/single_input/10/r/10.json diff --git a/tests/res/cli/single_input/10/oo/20.json b/tests/res/1/cli/single_input/10/r/20.json similarity index 100% rename from tests/res/cli/single_input/10/oo/20.json rename to tests/res/1/cli/single_input/10/r/20.json diff --git a/tests/res/cli/single_input/20/30.json b/tests/res/1/cli/single_input/10/r/30.json similarity index 100% rename from tests/res/cli/single_input/20/30.json rename to tests/res/1/cli/single_input/10/r/30.json diff --git a/tests/res/cli/single_input/40/10.json b/tests/res/1/cli/single_input/20/10.json similarity index 100% rename from tests/res/cli/single_input/40/10.json rename to tests/res/1/cli/single_input/20/10.json diff --git a/tests/res/cli/single_input/10/r/20.json b/tests/res/1/cli/single_input/20/20.json similarity index 100% rename from tests/res/cli/single_input/10/r/20.json rename to tests/res/1/cli/single_input/20/20.json diff --git a/tests/res/cli/single_input/20/on/30.json b/tests/res/1/cli/single_input/20/30.json similarity index 100% rename from tests/res/cli/single_input/20/on/30.json rename to tests/res/1/cli/single_input/20/30.json diff --git a/tests/res/cli/single_input/20/e/10.json b/tests/res/1/cli/single_input/20/e/10.json similarity index 100% rename from tests/res/cli/single_input/20/e/10.json rename to tests/res/1/cli/single_input/20/e/10.json diff --git a/tests/res/cli/single_input/20/20.json b/tests/res/1/cli/single_input/20/e/20.json similarity index 100% rename from tests/res/cli/single_input/20/20.json rename to tests/res/1/cli/single_input/20/e/20.json diff --git a/tests/res/cli/single_input/20/e/30.json b/tests/res/1/cli/single_input/20/e/30.json similarity index 100% rename from tests/res/cli/single_input/20/e/30.json rename to tests/res/1/cli/single_input/20/e/30.json diff --git a/tests/res/cli/single_input/20/o/10.json b/tests/res/1/cli/single_input/20/o/10.json similarity index 100% rename from tests/res/cli/single_input/20/o/10.json rename to tests/res/1/cli/single_input/20/o/10.json diff --git a/tests/res/cli/single_input/20/o/20.json b/tests/res/1/cli/single_input/20/o/20.json similarity index 100% rename from tests/res/cli/single_input/20/o/20.json rename to tests/res/1/cli/single_input/20/o/20.json diff --git a/tests/res/cli/single_input/20/o/30.json b/tests/res/1/cli/single_input/20/o/30.json similarity index 100% rename from tests/res/cli/single_input/20/o/30.json rename to tests/res/1/cli/single_input/20/o/30.json diff --git a/tests/res/cli/single_input/20/on/10.json b/tests/res/1/cli/single_input/20/on/10.json similarity index 100% rename from tests/res/cli/single_input/20/on/10.json rename to tests/res/1/cli/single_input/20/on/10.json diff --git a/tests/res/cli/single_input/20/e/20.json b/tests/res/1/cli/single_input/20/on/20.json similarity index 100% rename from tests/res/cli/single_input/20/e/20.json rename to tests/res/1/cli/single_input/20/on/20.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/e/30.json b/tests/res/1/cli/single_input/20/on/30.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/e/30.json rename to tests/res/1/cli/single_input/20/on/30.json diff --git a/tests/res/single_load/primitives/10/10.json b/tests/res/1/cli/single_input/20/r/10.json similarity index 100% rename from tests/res/single_load/primitives/10/10.json rename to tests/res/1/cli/single_input/20/r/10.json diff --git a/tests/res/json/primitives/e/40.txt b/tests/res/1/cli/single_input/20/r/20.json similarity index 100% rename from tests/res/json/primitives/e/40.txt rename to tests/res/1/cli/single_input/20/r/20.json diff --git a/tests/res/dicts/merge/20/10.json b/tests/res/1/cli/single_input/30/10.json similarity index 100% rename from tests/res/dicts/merge/20/10.json rename to tests/res/1/cli/single_input/30/10.json diff --git a/tests/res/cli/single_input/20/on/20.json b/tests/res/1/cli/single_input/30/20.json similarity index 100% rename from tests/res/cli/single_input/20/on/20.json rename to tests/res/1/cli/single_input/30/20.json diff --git a/tests/res/cli/single_input/30/e/10.json b/tests/res/1/cli/single_input/30/e/10.json similarity index 100% rename from tests/res/cli/single_input/30/e/10.json rename to tests/res/1/cli/single_input/30/e/10.json diff --git a/tests/res/cli/single_input/30/20.json b/tests/res/1/cli/single_input/30/e/20.json similarity index 100% rename from tests/res/cli/single_input/30/20.json rename to tests/res/1/cli/single_input/30/e/20.json diff --git a/tests/res/cli/single_input/30/o/10.json b/tests/res/1/cli/single_input/30/o/10.json similarity index 100% rename from tests/res/cli/single_input/30/o/10.json rename to tests/res/1/cli/single_input/30/o/10.json diff --git a/tests/res/cli/single_input/30/o/20.json b/tests/res/1/cli/single_input/30/o/20.json similarity index 100% rename from tests/res/cli/single_input/30/o/20.json rename to tests/res/1/cli/single_input/30/o/20.json diff --git a/tests/res/cli/single_input/30/on/10.json b/tests/res/1/cli/single_input/30/on/10.json similarity index 100% rename from tests/res/cli/single_input/30/on/10.json rename to tests/res/1/cli/single_input/30/on/10.json diff --git a/tests/res/cli/single_input/30/e/20.json b/tests/res/1/cli/single_input/30/on/20.json similarity index 100% rename from tests/res/cli/single_input/30/e/20.json rename to tests/res/1/cli/single_input/30/on/20.json diff --git a/tests/res/cli/single_input/30/r/10.json b/tests/res/1/cli/single_input/30/r/10.json similarity index 100% rename from tests/res/cli/single_input/30/r/10.json rename to tests/res/1/cli/single_input/30/r/10.json diff --git a/tests/res/cli/single_input/30/r/20.json b/tests/res/1/cli/single_input/30/r/20.json similarity index 100% rename from tests/res/cli/single_input/30/r/20.json rename to tests/res/1/cli/single_input/30/r/20.json diff --git a/tests/res/dicts/merge/30/10.json b/tests/res/1/cli/single_input/40/10.json similarity index 100% rename from tests/res/dicts/merge/30/10.json rename to tests/res/1/cli/single_input/40/10.json diff --git a/tests/res/cli/single_input/40/e/10.json b/tests/res/1/cli/single_input/40/e/10.json similarity index 100% rename from tests/res/cli/single_input/40/e/10.json rename to tests/res/1/cli/single_input/40/e/10.json diff --git a/tests/res/cli/single_input/40/o/10.json b/tests/res/1/cli/single_input/40/o/10.json similarity index 100% rename from tests/res/cli/single_input/40/o/10.json rename to tests/res/1/cli/single_input/40/o/10.json diff --git a/tests/res/cli/single_input/40/on/10.json b/tests/res/1/cli/single_input/40/on/10.json similarity index 100% rename from tests/res/cli/single_input/40/on/10.json rename to tests/res/1/cli/single_input/40/on/10.json diff --git a/tests/res/cli/single_input/40/r/10.json b/tests/res/1/cli/single_input/40/r/10.json similarity index 100% rename from tests/res/cli/single_input/40/r/10.json rename to tests/res/1/cli/single_input/40/r/10.json diff --git a/tests/res/cli/schema/10/10.json b/tests/res/1/cli/single_input/50/10.json similarity index 100% rename from tests/res/cli/schema/10/10.json rename to tests/res/1/cli/single_input/50/10.json diff --git a/tests/res/cli/single_input/50/e/10.json b/tests/res/1/cli/single_input/50/e/10.json similarity index 100% rename from tests/res/cli/single_input/50/e/10.json rename to tests/res/1/cli/single_input/50/e/10.json diff --git a/tests/res/cli/single_input/50/o/10.json b/tests/res/1/cli/single_input/50/o/10.json similarity index 100% rename from tests/res/cli/single_input/50/o/10.json rename to tests/res/1/cli/single_input/50/o/10.json diff --git a/tests/res/cli/single_input/50/on/10.json b/tests/res/1/cli/single_input/50/on/10.json similarity index 100% rename from tests/res/cli/single_input/50/on/10.json rename to tests/res/1/cli/single_input/50/on/10.json diff --git a/tests/res/cli/schema/10/s/10.json b/tests/res/1/cli/single_input/50/r/10.json similarity index 100% rename from tests/res/cli/schema/10/s/10.json rename to tests/res/1/cli/single_input/50/r/10.json diff --git a/tests/res/cli/single_input/50/10.json b/tests/res/1/cli/single_input_to_yaml_output/10/10.json similarity index 100% rename from tests/res/cli/single_input/50/10.json rename to tests/res/1/cli/single_input_to_yaml_output/10/10.json diff --git a/tests/res/cli/single_input/30/on/20.json b/tests/res/1/cli/single_input_to_yaml_output/10/20.json similarity index 100% rename from tests/res/cli/single_input/30/on/20.json rename to tests/res/1/cli/single_input_to_yaml_output/10/20.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/30.yml b/tests/res/1/cli/single_input_to_yaml_output/10/30.yml similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/30.yml rename to tests/res/1/cli/single_input_to_yaml_output/10/30.yml diff --git a/tests/res/cli/single_input_to_yaml_output/10/40.yml b/tests/res/1/cli/single_input_to_yaml_output/10/40.yml similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/40.yml rename to tests/res/1/cli/single_input_to_yaml_output/10/40.yml diff --git a/tests/res/cli/single_input_to_yaml_output/10/e/10.json b/tests/res/1/cli/single_input_to_yaml_output/10/e/10.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/e/10.json rename to tests/res/1/cli/single_input_to_yaml_output/10/e/10.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/20.json b/tests/res/1/cli/single_input_to_yaml_output/10/e/20.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/20.json rename to tests/res/1/cli/single_input_to_yaml_output/10/e/20.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/o/30.json b/tests/res/1/cli/single_input_to_yaml_output/10/e/30.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/o/30.json rename to tests/res/1/cli/single_input_to_yaml_output/10/e/30.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/e/40.json b/tests/res/1/cli/single_input_to_yaml_output/10/e/40.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/e/40.json rename to tests/res/1/cli/single_input_to_yaml_output/10/e/40.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/o/10.json b/tests/res/1/cli/single_input_to_yaml_output/10/o/10.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/o/10.json rename to tests/res/1/cli/single_input_to_yaml_output/10/o/10.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/o/20.json b/tests/res/1/cli/single_input_to_yaml_output/10/o/20.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/o/20.json rename to tests/res/1/cli/single_input_to_yaml_output/10/o/20.json diff --git a/tests/res/dicts/get/30/30.json b/tests/res/1/cli/single_input_to_yaml_output/10/o/30.json similarity index 100% rename from tests/res/dicts/get/30/30.json rename to tests/res/1/cli/single_input_to_yaml_output/10/o/30.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/o/40.json b/tests/res/1/cli/single_input_to_yaml_output/10/o/40.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/o/40.json rename to tests/res/1/cli/single_input_to_yaml_output/10/o/40.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/on/10.json b/tests/res/1/cli/single_input_to_yaml_output/10/on/10.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/on/10.json rename to tests/res/1/cli/single_input_to_yaml_output/10/on/10.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/e/20.json b/tests/res/1/cli/single_input_to_yaml_output/10/on/20.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/e/20.json rename to tests/res/1/cli/single_input_to_yaml_output/10/on/20.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/on/30.json b/tests/res/1/cli/single_input_to_yaml_output/10/on/30.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/on/30.json rename to tests/res/1/cli/single_input_to_yaml_output/10/on/30.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/on/40.json b/tests/res/1/cli/single_input_to_yaml_output/10/on/40.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/on/40.json rename to tests/res/1/cli/single_input_to_yaml_output/10/on/40.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/oo/10.json b/tests/res/1/cli/single_input_to_yaml_output/10/oo/10.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/oo/10.json rename to tests/res/1/cli/single_input_to_yaml_output/10/oo/10.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/on/20.json b/tests/res/1/cli/single_input_to_yaml_output/10/oo/20.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/on/20.json rename to tests/res/1/cli/single_input_to_yaml_output/10/oo/20.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/oo/30.json b/tests/res/1/cli/single_input_to_yaml_output/10/oo/30.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/oo/30.json rename to tests/res/1/cli/single_input_to_yaml_output/10/oo/30.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/oo/40.json b/tests/res/1/cli/single_input_to_yaml_output/10/oo/40.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/oo/40.json rename to tests/res/1/cli/single_input_to_yaml_output/10/oo/40.json diff --git a/tests/res/single_load/basics/20/e/10.json b/tests/res/1/cli/single_input_to_yaml_output/10/r/10.json similarity index 100% rename from tests/res/single_load/basics/20/e/10.json rename to tests/res/1/cli/single_input_to_yaml_output/10/r/10.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/oo/20.json b/tests/res/1/cli/single_input_to_yaml_output/10/r/20.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/oo/20.json rename to tests/res/1/cli/single_input_to_yaml_output/10/r/20.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/r/30.json b/tests/res/1/cli/single_input_to_yaml_output/10/r/30.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/r/30.json rename to tests/res/1/cli/single_input_to_yaml_output/10/r/30.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/r/40.json b/tests/res/1/cli/single_input_to_yaml_output/10/r/40.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/r/40.json rename to tests/res/1/cli/single_input_to_yaml_output/10/r/40.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/10.json b/tests/res/1/cli/template/10/10.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/10.json rename to tests/res/1/cli/template/10/10.json diff --git a/tests/res/cli/template/10/20.json b/tests/res/1/cli/template/10/20.json similarity index 100% rename from tests/res/cli/template/10/20.json rename to tests/res/1/cli/template/10/20.json diff --git a/tests/res/cli/template/10/e/10.json b/tests/res/1/cli/template/10/e/10.json similarity index 100% rename from tests/res/cli/template/10/e/10.json rename to tests/res/1/cli/template/10/e/10.json diff --git a/tests/res/cli/single_input_to_yaml_output/10/r/20.json b/tests/res/1/cli/template/10/e/20.json similarity index 100% rename from tests/res/cli/single_input_to_yaml_output/10/r/20.json rename to tests/res/1/cli/template/10/e/20.json diff --git a/tests/res/cli/template/10/o/10.json b/tests/res/1/cli/template/10/o/10.json similarity index 100% rename from tests/res/cli/template/10/o/10.json rename to tests/res/1/cli/template/10/o/10.json diff --git a/tests/res/cli/template/10/e/20.json b/tests/res/1/cli/template/10/o/20.json similarity index 100% rename from tests/res/cli/template/10/e/20.json rename to tests/res/1/cli/template/10/o/20.json diff --git a/tests/res/cli/template/10/on/10.json b/tests/res/1/cli/template/10/on/10.json similarity index 100% rename from tests/res/cli/template/10/on/10.json rename to tests/res/1/cli/template/10/on/10.json diff --git a/tests/res/cli/template/10/o/20.json b/tests/res/1/cli/template/10/on/20.json similarity index 100% rename from tests/res/cli/template/10/o/20.json rename to tests/res/1/cli/template/10/on/20.json diff --git a/tests/res/cli/template/10/r/10.json b/tests/res/1/cli/template/10/r/10.json similarity index 100% rename from tests/res/cli/template/10/r/10.json rename to tests/res/1/cli/template/10/r/10.json diff --git a/tests/res/cli/template/10/r/20.json b/tests/res/1/cli/template/10/r/20.json similarity index 100% rename from tests/res/cli/template/10/r/20.json rename to tests/res/1/cli/template/10/r/20.json diff --git a/tests/res/1/common/tdc/10/100_null.json b/tests/res/1/common/tdc/10/100_null.json new file mode 120000 index 00000000..acf38797 --- /dev/null +++ b/tests/res/1/common/tdc/10/100_null.json @@ -0,0 +1 @@ +../../../loaders/json.stdlib/10/100_null.json \ No newline at end of file diff --git a/tests/res/1/common/tdc/10/e/100_null.json.py b/tests/res/1/common/tdc/10/e/100_null.json.py new file mode 120000 index 00000000..953fe6df --- /dev/null +++ b/tests/res/1/common/tdc/10/e/100_null.json.py @@ -0,0 +1 @@ +../../../../loaders/json.stdlib/10/e/100_null.json.py \ No newline at end of file diff --git a/tests/res/1/common/tdc/20/220_a_list.json b/tests/res/1/common/tdc/20/220_a_list.json new file mode 120000 index 00000000..5c977d1a --- /dev/null +++ b/tests/res/1/common/tdc/20/220_a_list.json @@ -0,0 +1 @@ +../../../loaders/json.stdlib/20/220_a_list.json \ No newline at end of file diff --git a/tests/res/1/common/tdc/20/e/220_a_list.json.py b/tests/res/1/common/tdc/20/e/220_a_list.json.py new file mode 120000 index 00000000..f1ec22b1 --- /dev/null +++ b/tests/res/1/common/tdc/20/e/220_a_list.json.py @@ -0,0 +1 @@ +../../../../loaders/json.stdlib/20/e/220_a_list.json.py \ No newline at end of file diff --git a/tests/res/1/common/tdc/20/o/220_a_list.json.json b/tests/res/1/common/tdc/20/o/220_a_list.json.json new file mode 120000 index 00000000..3a329717 --- /dev/null +++ b/tests/res/1/common/tdc/20/o/220_a_list.json.json @@ -0,0 +1 @@ +../../../../loaders/json.stdlib/20/o/220_a_list.json.json \ No newline at end of file diff --git a/tests/res/dicts/get/10/10.json b/tests/res/1/dicts/get/10/10.json similarity index 100% rename from tests/res/dicts/get/10/10.json rename to tests/res/1/dicts/get/10/10.json diff --git a/tests/res/cli/template/10/on/20.json b/tests/res/1/dicts/get/10/20.json similarity index 100% rename from tests/res/cli/template/10/on/20.json rename to tests/res/1/dicts/get/10/20.json diff --git a/tests/res/single_load/basics/30/e/10.json b/tests/res/1/dicts/get/10/e/10.json similarity index 100% rename from tests/res/single_load/basics/30/e/10.json rename to tests/res/1/dicts/get/10/e/10.json diff --git a/tests/res/single_load/query/10/e/00_00.json b/tests/res/1/dicts/get/10/e/20.json similarity index 100% rename from tests/res/single_load/query/10/e/00_00.json rename to tests/res/1/dicts/get/10/e/20.json diff --git a/tests/res/dicts/get/10/q/10.py b/tests/res/1/dicts/get/10/q/10.py similarity index 100% rename from tests/res/dicts/get/10/q/10.py rename to tests/res/1/dicts/get/10/q/10.py diff --git a/tests/res/dicts/get/10/q/20.py b/tests/res/1/dicts/get/10/q/20.py similarity index 100% rename from tests/res/dicts/get/10/q/20.py rename to tests/res/1/dicts/get/10/q/20.py diff --git a/tests/res/dicts/get/10/s/10.py b/tests/res/1/dicts/get/10/s/10.py similarity index 100% rename from tests/res/dicts/get/10/s/10.py rename to tests/res/1/dicts/get/10/s/10.py diff --git a/tests/res/dicts/get/10/s/20.py b/tests/res/1/dicts/get/10/s/20.py similarity index 100% rename from tests/res/dicts/get/10/s/20.py rename to tests/res/1/dicts/get/10/s/20.py diff --git a/tests/res/dicts/get/20/00.json b/tests/res/1/dicts/get/20/00.json similarity index 100% rename from tests/res/dicts/get/20/00.json rename to tests/res/1/dicts/get/20/00.json diff --git a/tests/res/single_load/template/10/o/10.json b/tests/res/1/dicts/get/20/10.json similarity index 100% rename from tests/res/single_load/template/10/o/10.json rename to tests/res/1/dicts/get/20/10.json diff --git a/tests/res/dicts/get/20/100.json b/tests/res/1/dicts/get/20/100.json similarity index 100% rename from tests/res/dicts/get/20/100.json rename to tests/res/1/dicts/get/20/100.json diff --git a/tests/res/dicts/get/20/110.json b/tests/res/1/dicts/get/20/110.json similarity index 100% rename from tests/res/dicts/get/20/110.json rename to tests/res/1/dicts/get/20/110.json diff --git a/tests/res/single_load/template/10/o/20.json b/tests/res/1/dicts/get/20/20.json similarity index 100% rename from tests/res/single_load/template/10/o/20.json rename to tests/res/1/dicts/get/20/20.json diff --git a/tests/res/single_load/template/10/o/30.json b/tests/res/1/dicts/get/20/30.json similarity index 100% rename from tests/res/single_load/template/10/o/30.json rename to tests/res/1/dicts/get/20/30.json diff --git a/tests/res/dicts/get/20/40.json b/tests/res/1/dicts/get/20/40.json similarity index 100% rename from tests/res/dicts/get/20/40.json rename to tests/res/1/dicts/get/20/40.json diff --git a/tests/res/dicts/get/20/50.json b/tests/res/1/dicts/get/20/50.json similarity index 100% rename from tests/res/dicts/get/20/50.json rename to tests/res/1/dicts/get/20/50.json diff --git a/tests/res/dicts/get/20/60.json b/tests/res/1/dicts/get/20/60.json similarity index 100% rename from tests/res/dicts/get/20/60.json rename to tests/res/1/dicts/get/20/60.json diff --git a/tests/res/dicts/get/20/70.json b/tests/res/1/dicts/get/20/70.json similarity index 100% rename from tests/res/dicts/get/20/70.json rename to tests/res/1/dicts/get/20/70.json diff --git a/tests/res/dicts/get/20/80.json b/tests/res/1/dicts/get/20/80.json similarity index 100% rename from tests/res/dicts/get/20/80.json rename to tests/res/1/dicts/get/20/80.json diff --git a/tests/res/dicts/get/20/90.json b/tests/res/1/dicts/get/20/90.json similarity index 100% rename from tests/res/dicts/get/20/90.json rename to tests/res/1/dicts/get/20/90.json diff --git a/tests/res/single_load/basics/30/e/00.json b/tests/res/1/dicts/get/20/e/00.json similarity index 100% rename from tests/res/single_load/basics/30/e/00.json rename to tests/res/1/dicts/get/20/e/00.json diff --git a/tests/res/dicts/get/20/e/10.json b/tests/res/1/dicts/get/20/e/10.json similarity index 100% rename from tests/res/dicts/get/20/e/10.json rename to tests/res/1/dicts/get/20/e/10.json diff --git a/tests/res/dicts/get/20/e/100.py b/tests/res/1/dicts/get/20/e/100.py similarity index 100% rename from tests/res/dicts/get/20/e/100.py rename to tests/res/1/dicts/get/20/e/100.py diff --git a/tests/res/dicts/get/20/e/110.py b/tests/res/1/dicts/get/20/e/110.py similarity index 100% rename from tests/res/dicts/get/20/e/110.py rename to tests/res/1/dicts/get/20/e/110.py diff --git a/tests/res/dicts/get/20/e/20.py b/tests/res/1/dicts/get/20/e/20.py similarity index 100% rename from tests/res/dicts/get/20/e/20.py rename to tests/res/1/dicts/get/20/e/20.py diff --git a/tests/res/dicts/get/20/e/30.py b/tests/res/1/dicts/get/20/e/30.py similarity index 100% rename from tests/res/dicts/get/20/e/30.py rename to tests/res/1/dicts/get/20/e/30.py diff --git a/tests/res/json/primitives/e/10.txt b/tests/res/1/dicts/get/20/e/40.py similarity index 100% rename from tests/res/json/primitives/e/10.txt rename to tests/res/1/dicts/get/20/e/40.py diff --git a/tests/res/dicts/get/20/e/50.py b/tests/res/1/dicts/get/20/e/50.py similarity index 100% rename from tests/res/dicts/get/20/e/50.py rename to tests/res/1/dicts/get/20/e/50.py diff --git a/tests/res/dicts/get/20/e/60.py b/tests/res/1/dicts/get/20/e/60.py similarity index 100% rename from tests/res/dicts/get/20/e/60.py rename to tests/res/1/dicts/get/20/e/60.py diff --git a/tests/res/dicts/get/20/e/70.py b/tests/res/1/dicts/get/20/e/70.py similarity index 100% rename from tests/res/dicts/get/20/e/70.py rename to tests/res/1/dicts/get/20/e/70.py diff --git a/tests/res/dicts/get/20/e/80.py b/tests/res/1/dicts/get/20/e/80.py similarity index 100% rename from tests/res/dicts/get/20/e/80.py rename to tests/res/1/dicts/get/20/e/80.py diff --git a/tests/res/dicts/get/20/e/90.py b/tests/res/1/dicts/get/20/e/90.py similarity index 100% rename from tests/res/dicts/get/20/e/90.py rename to tests/res/1/dicts/get/20/e/90.py diff --git a/tests/res/dicts/get/20/q/00.py b/tests/res/1/dicts/get/20/q/00.py similarity index 100% rename from tests/res/dicts/get/20/q/00.py rename to tests/res/1/dicts/get/20/q/00.py diff --git a/tests/res/dicts/get/20/q/10.py b/tests/res/1/dicts/get/20/q/10.py similarity index 100% rename from tests/res/dicts/get/20/q/10.py rename to tests/res/1/dicts/get/20/q/10.py diff --git a/tests/res/dicts/get/20/q/100.py b/tests/res/1/dicts/get/20/q/100.py similarity index 100% rename from tests/res/dicts/get/20/q/100.py rename to tests/res/1/dicts/get/20/q/100.py diff --git a/tests/res/dicts/get/20/q/110.py b/tests/res/1/dicts/get/20/q/110.py similarity index 100% rename from tests/res/dicts/get/20/q/110.py rename to tests/res/1/dicts/get/20/q/110.py diff --git a/tests/res/dicts/get/20/q/20.py b/tests/res/1/dicts/get/20/q/20.py similarity index 100% rename from tests/res/dicts/get/20/q/20.py rename to tests/res/1/dicts/get/20/q/20.py diff --git a/tests/res/dicts/get/20/q/30.py b/tests/res/1/dicts/get/20/q/30.py similarity index 100% rename from tests/res/dicts/get/20/q/30.py rename to tests/res/1/dicts/get/20/q/30.py diff --git a/tests/res/dicts/get/20/q/40.py b/tests/res/1/dicts/get/20/q/40.py similarity index 100% rename from tests/res/dicts/get/20/q/40.py rename to tests/res/1/dicts/get/20/q/40.py diff --git a/tests/res/dicts/get/20/q/50.py b/tests/res/1/dicts/get/20/q/50.py similarity index 100% rename from tests/res/dicts/get/20/q/50.py rename to tests/res/1/dicts/get/20/q/50.py diff --git a/tests/res/dicts/get/20/q/60.py b/tests/res/1/dicts/get/20/q/60.py similarity index 100% rename from tests/res/dicts/get/20/q/60.py rename to tests/res/1/dicts/get/20/q/60.py diff --git a/tests/res/dicts/get/20/q/70.py b/tests/res/1/dicts/get/20/q/70.py similarity index 100% rename from tests/res/dicts/get/20/q/70.py rename to tests/res/1/dicts/get/20/q/70.py diff --git a/tests/res/dicts/get/20/q/80.py b/tests/res/1/dicts/get/20/q/80.py similarity index 100% rename from tests/res/dicts/get/20/q/80.py rename to tests/res/1/dicts/get/20/q/80.py diff --git a/tests/res/dicts/get/20/q/90.py b/tests/res/1/dicts/get/20/q/90.py similarity index 100% rename from tests/res/dicts/get/20/q/90.py rename to tests/res/1/dicts/get/20/q/90.py diff --git a/tests/res/dicts/get/20/s/00.py b/tests/res/1/dicts/get/20/s/00.py similarity index 100% rename from tests/res/dicts/get/20/s/00.py rename to tests/res/1/dicts/get/20/s/00.py diff --git a/tests/res/dicts/get/20/s/10.py b/tests/res/1/dicts/get/20/s/10.py similarity index 100% rename from tests/res/dicts/get/20/s/10.py rename to tests/res/1/dicts/get/20/s/10.py diff --git a/tests/res/dicts/get/20/s/100.py b/tests/res/1/dicts/get/20/s/100.py similarity index 100% rename from tests/res/dicts/get/20/s/100.py rename to tests/res/1/dicts/get/20/s/100.py diff --git a/tests/res/dicts/get/20/s/110.py b/tests/res/1/dicts/get/20/s/110.py similarity index 100% rename from tests/res/dicts/get/20/s/110.py rename to tests/res/1/dicts/get/20/s/110.py diff --git a/tests/res/dicts/get/20/s/20.py b/tests/res/1/dicts/get/20/s/20.py similarity index 100% rename from tests/res/dicts/get/20/s/20.py rename to tests/res/1/dicts/get/20/s/20.py diff --git a/tests/res/dicts/get/20/s/30.py b/tests/res/1/dicts/get/20/s/30.py similarity index 100% rename from tests/res/dicts/get/20/s/30.py rename to tests/res/1/dicts/get/20/s/30.py diff --git a/tests/res/dicts/get/20/s/40.py b/tests/res/1/dicts/get/20/s/40.py similarity index 100% rename from tests/res/dicts/get/20/s/40.py rename to tests/res/1/dicts/get/20/s/40.py diff --git a/tests/res/dicts/get/20/s/50.py b/tests/res/1/dicts/get/20/s/50.py similarity index 100% rename from tests/res/dicts/get/20/s/50.py rename to tests/res/1/dicts/get/20/s/50.py diff --git a/tests/res/dicts/get/20/s/60.py b/tests/res/1/dicts/get/20/s/60.py similarity index 100% rename from tests/res/dicts/get/20/s/60.py rename to tests/res/1/dicts/get/20/s/60.py diff --git a/tests/res/dicts/get/20/s/70.py b/tests/res/1/dicts/get/20/s/70.py similarity index 100% rename from tests/res/dicts/get/20/s/70.py rename to tests/res/1/dicts/get/20/s/70.py diff --git a/tests/res/dicts/get/20/s/80.py b/tests/res/1/dicts/get/20/s/80.py similarity index 100% rename from tests/res/dicts/get/20/s/80.py rename to tests/res/1/dicts/get/20/s/80.py diff --git a/tests/res/dicts/get/20/s/90.py b/tests/res/1/dicts/get/20/s/90.py similarity index 100% rename from tests/res/dicts/get/20/s/90.py rename to tests/res/1/dicts/get/20/s/90.py diff --git a/tests/res/dicts/get/30/10.json b/tests/res/1/dicts/get/30/10.json similarity index 100% rename from tests/res/dicts/get/30/10.json rename to tests/res/1/dicts/get/30/10.json diff --git a/tests/res/dicts/get/10/20.json b/tests/res/1/dicts/get/30/20.json similarity index 100% rename from tests/res/dicts/get/10/20.json rename to tests/res/1/dicts/get/30/20.json diff --git a/tests/res/dicts/get/30/20.json b/tests/res/1/dicts/get/30/30.json similarity index 100% rename from tests/res/dicts/get/30/20.json rename to tests/res/1/dicts/get/30/30.json diff --git a/tests/res/dicts/get/30/e/10.py b/tests/res/1/dicts/get/30/e/10.py similarity index 100% rename from tests/res/dicts/get/30/e/10.py rename to tests/res/1/dicts/get/30/e/10.py diff --git a/tests/res/single_load/query/10/e/20_20.json b/tests/res/1/dicts/get/30/e/20.json similarity index 100% rename from tests/res/single_load/query/10/e/20_20.json rename to tests/res/1/dicts/get/30/e/20.json diff --git a/tests/res/1/dicts/get/30/e/30.json b/tests/res/1/dicts/get/30/e/30.json new file mode 100644 index 00000000..19765bd5 --- /dev/null +++ b/tests/res/1/dicts/get/30/e/30.json @@ -0,0 +1 @@ +null diff --git a/tests/res/dicts/get/30/q/10.txt b/tests/res/1/dicts/get/30/q/10.txt similarity index 100% rename from tests/res/dicts/get/30/q/10.txt rename to tests/res/1/dicts/get/30/q/10.txt diff --git a/tests/res/dicts/get/30/q/20.txt b/tests/res/1/dicts/get/30/q/20.txt similarity index 100% rename from tests/res/dicts/get/30/q/20.txt rename to tests/res/1/dicts/get/30/q/20.txt diff --git a/tests/res/dicts/get/30/q/30.txt b/tests/res/1/dicts/get/30/q/30.txt similarity index 100% rename from tests/res/dicts/get/30/q/30.txt rename to tests/res/1/dicts/get/30/q/30.txt diff --git a/tests/res/parser/list/10/00.txt b/tests/res/1/dicts/get/30/s/10.txt similarity index 100% rename from tests/res/parser/list/10/00.txt rename to tests/res/1/dicts/get/30/s/10.txt diff --git a/tests/res/dicts/get/30/s/20.txt b/tests/res/1/dicts/get/30/s/20.txt similarity index 100% rename from tests/res/dicts/get/30/s/20.txt rename to tests/res/1/dicts/get/30/s/20.txt diff --git a/tests/res/dicts/get/30/s/30.txt b/tests/res/1/dicts/get/30/s/30.txt similarity index 100% rename from tests/res/dicts/get/30/s/30.txt rename to tests/res/1/dicts/get/30/s/30.txt diff --git a/tests/res/dicts/merge/10/10.json b/tests/res/1/dicts/merge/10/10.json similarity index 100% rename from tests/res/dicts/merge/10/10.json rename to tests/res/1/dicts/merge/10/10.json diff --git a/tests/res/dicts/merge/10/e/10.json b/tests/res/1/dicts/merge/10/e/10.json similarity index 100% rename from tests/res/dicts/merge/10/e/10.json rename to tests/res/1/dicts/merge/10/e/10.json diff --git a/tests/res/dicts/merge/10/o/10.json b/tests/res/1/dicts/merge/10/o/10.json similarity index 100% rename from tests/res/dicts/merge/10/o/10.json rename to tests/res/1/dicts/merge/10/o/10.json diff --git a/tests/res/dicts/merge/10/s/10.json b/tests/res/1/dicts/merge/10/s/10.json similarity index 100% rename from tests/res/dicts/merge/10/s/10.json rename to tests/res/1/dicts/merge/10/s/10.json diff --git a/tests/res/dicts/merge/40/10.json b/tests/res/1/dicts/merge/20/10.json similarity index 100% rename from tests/res/dicts/merge/40/10.json rename to tests/res/1/dicts/merge/20/10.json diff --git a/tests/res/dicts/merge/20/e/10.json b/tests/res/1/dicts/merge/20/e/10.json similarity index 100% rename from tests/res/dicts/merge/20/e/10.json rename to tests/res/1/dicts/merge/20/e/10.json diff --git a/tests/res/dicts/merge/20/o/10.json b/tests/res/1/dicts/merge/20/o/10.json similarity index 100% rename from tests/res/dicts/merge/20/o/10.json rename to tests/res/1/dicts/merge/20/o/10.json diff --git a/tests/res/dicts/merge/20/s/10.json b/tests/res/1/dicts/merge/20/s/10.json similarity index 100% rename from tests/res/dicts/merge/20/s/10.json rename to tests/res/1/dicts/merge/20/s/10.json diff --git a/tests/res/single_load/basics/20/10.json b/tests/res/1/dicts/merge/30/10.json similarity index 100% rename from tests/res/single_load/basics/20/10.json rename to tests/res/1/dicts/merge/30/10.json diff --git a/tests/res/dicts/merge/30/e/10.json b/tests/res/1/dicts/merge/30/e/10.json similarity index 100% rename from tests/res/dicts/merge/30/e/10.json rename to tests/res/1/dicts/merge/30/e/10.json diff --git a/tests/res/dicts/merge/30/o/10.json b/tests/res/1/dicts/merge/30/o/10.json similarity index 100% rename from tests/res/dicts/merge/30/o/10.json rename to tests/res/1/dicts/merge/30/o/10.json diff --git a/tests/res/dicts/merge/30/s/10.json b/tests/res/1/dicts/merge/30/s/10.json similarity index 100% rename from tests/res/dicts/merge/30/s/10.json rename to tests/res/1/dicts/merge/30/s/10.json diff --git a/tests/res/single_load/basics/30/10.json b/tests/res/1/dicts/merge/40/10.json similarity index 100% rename from tests/res/single_load/basics/30/10.json rename to tests/res/1/dicts/merge/40/10.json diff --git a/tests/res/dicts/merge/40/e/10.json b/tests/res/1/dicts/merge/40/e/10.json similarity index 100% rename from tests/res/dicts/merge/40/e/10.json rename to tests/res/1/dicts/merge/40/e/10.json diff --git a/tests/res/dicts/merge/40/o/10.json b/tests/res/1/dicts/merge/40/o/10.json similarity index 100% rename from tests/res/dicts/merge/40/o/10.json rename to tests/res/1/dicts/merge/40/o/10.json diff --git a/tests/res/dicts/merge/40/s/10.json b/tests/res/1/dicts/merge/40/s/10.json similarity index 100% rename from tests/res/dicts/merge/40/s/10.json rename to tests/res/1/dicts/merge/40/s/10.json diff --git a/tests/res/dicts/mk_nested_dic/10/10.py b/tests/res/1/dicts/mk_nested_dic/10/10.py similarity index 100% rename from tests/res/dicts/mk_nested_dic/10/10.py rename to tests/res/1/dicts/mk_nested_dic/10/10.py diff --git a/tests/res/dicts/mk_nested_dic/10/20.py b/tests/res/1/dicts/mk_nested_dic/10/20.py similarity index 100% rename from tests/res/dicts/mk_nested_dic/10/20.py rename to tests/res/1/dicts/mk_nested_dic/10/20.py diff --git a/tests/res/dicts/mk_nested_dic/10/e/10.json b/tests/res/1/dicts/mk_nested_dic/10/e/10.json similarity index 100% rename from tests/res/dicts/mk_nested_dic/10/e/10.json rename to tests/res/1/dicts/mk_nested_dic/10/e/10.json diff --git a/tests/res/dicts/mk_nested_dic/10/e/20.json b/tests/res/1/dicts/mk_nested_dic/10/e/20.json similarity index 100% rename from tests/res/dicts/mk_nested_dic/10/e/20.json rename to tests/res/1/dicts/mk_nested_dic/10/e/20.json diff --git a/tests/res/dicts/mk_nested_dic/10/o/10.json b/tests/res/1/dicts/mk_nested_dic/10/o/10.json similarity index 100% rename from tests/res/dicts/mk_nested_dic/10/o/10.json rename to tests/res/1/dicts/mk_nested_dic/10/o/10.json diff --git a/tests/res/dicts/mk_nested_dic/10/o/20.json b/tests/res/1/dicts/mk_nested_dic/10/o/20.json similarity index 100% rename from tests/res/dicts/mk_nested_dic/10/o/20.json rename to tests/res/1/dicts/mk_nested_dic/10/o/20.json diff --git a/tests/res/single_load/query/10/e/00_10.json b/tests/res/1/dicts/mk_nested_dic/10/q/10.py similarity index 100% rename from tests/res/single_load/query/10/e/00_10.json rename to tests/res/1/dicts/mk_nested_dic/10/q/10.py diff --git a/tests/res/dicts/mk_nested_dic/10/q/20.py b/tests/res/1/dicts/mk_nested_dic/10/q/20.py similarity index 100% rename from tests/res/dicts/mk_nested_dic/10/q/20.py rename to tests/res/1/dicts/mk_nested_dic/10/q/20.py diff --git a/tests/res/single_load/basics/20/test_cases_with_schema_validation.txt b/tests/res/1/parser/attrlist/10/00.txt similarity index 100% rename from tests/res/single_load/basics/20/test_cases_with_schema_validation.txt rename to tests/res/1/parser/attrlist/10/00.txt diff --git a/tests/res/parser/attrlist/10/10.txt b/tests/res/1/parser/attrlist/10/10.txt similarity index 100% rename from tests/res/parser/attrlist/10/10.txt rename to tests/res/1/parser/attrlist/10/10.txt diff --git a/tests/res/parser/attrlist/10/20.txt b/tests/res/1/parser/attrlist/10/20.txt similarity index 100% rename from tests/res/parser/attrlist/10/20.txt rename to tests/res/1/parser/attrlist/10/20.txt diff --git a/tests/res/parser/attrlist/10/30.txt b/tests/res/1/parser/attrlist/10/30.txt similarity index 100% rename from tests/res/parser/attrlist/10/30.txt rename to tests/res/1/parser/attrlist/10/30.txt diff --git a/tests/res/parser/attrlist/10/40.txt b/tests/res/1/parser/attrlist/10/40.txt similarity index 100% rename from tests/res/parser/attrlist/10/40.txt rename to tests/res/1/parser/attrlist/10/40.txt diff --git a/tests/res/multi_load/schema/00/o/00.json b/tests/res/1/parser/attrlist/10/e/00.json similarity index 100% rename from tests/res/multi_load/schema/00/o/00.json rename to tests/res/1/parser/attrlist/10/e/00.json diff --git a/tests/res/parser/attrlist/10/e/10.json b/tests/res/1/parser/attrlist/10/e/10.json similarity index 100% rename from tests/res/parser/attrlist/10/e/10.json rename to tests/res/1/parser/attrlist/10/e/10.json diff --git a/tests/res/parser/attrlist/10/e/20.json b/tests/res/1/parser/attrlist/10/e/20.json similarity index 100% rename from tests/res/parser/attrlist/10/e/20.json rename to tests/res/1/parser/attrlist/10/e/20.json diff --git a/tests/res/parser/attrlist/10/e/30.json b/tests/res/1/parser/attrlist/10/e/30.json similarity index 100% rename from tests/res/parser/attrlist/10/e/30.json rename to tests/res/1/parser/attrlist/10/e/30.json diff --git a/tests/res/parser/attrlist/10/e/40.json b/tests/res/1/parser/attrlist/10/e/40.json similarity index 100% rename from tests/res/parser/attrlist/10/e/40.json rename to tests/res/1/parser/attrlist/10/e/40.json diff --git a/tests/res/parser/attrlist_0/10/00.txt b/tests/res/1/parser/attrlist_0/10/00.txt similarity index 100% rename from tests/res/parser/attrlist_0/10/00.txt rename to tests/res/1/parser/attrlist_0/10/00.txt diff --git a/tests/res/parser/attrlist_0/10/10.txt b/tests/res/1/parser/attrlist_0/10/10.txt similarity index 100% rename from tests/res/parser/attrlist_0/10/10.txt rename to tests/res/1/parser/attrlist_0/10/10.txt diff --git a/tests/res/parser/attrlist_0/10/20.txt b/tests/res/1/parser/attrlist_0/10/20.txt similarity index 100% rename from tests/res/parser/attrlist_0/10/20.txt rename to tests/res/1/parser/attrlist_0/10/20.txt diff --git a/tests/res/parser/attrlist_0/10/30.txt b/tests/res/1/parser/attrlist_0/10/30.txt similarity index 100% rename from tests/res/parser/attrlist_0/10/30.txt rename to tests/res/1/parser/attrlist_0/10/30.txt diff --git a/tests/res/parser/attrlist_0/10/40.txt b/tests/res/1/parser/attrlist_0/10/40.txt similarity index 100% rename from tests/res/parser/attrlist_0/10/40.txt rename to tests/res/1/parser/attrlist_0/10/40.txt diff --git a/tests/res/parser/attrlist_0/10/e/00.json b/tests/res/1/parser/attrlist_0/10/e/00.json similarity index 100% rename from tests/res/parser/attrlist_0/10/e/00.json rename to tests/res/1/parser/attrlist_0/10/e/00.json diff --git a/tests/res/parser/attrlist_0/10/e/10.py b/tests/res/1/parser/attrlist_0/10/e/10.py similarity index 100% rename from tests/res/parser/attrlist_0/10/e/10.py rename to tests/res/1/parser/attrlist_0/10/e/10.py diff --git a/tests/res/parser/attrlist_0/10/e/20.py b/tests/res/1/parser/attrlist_0/10/e/20.py similarity index 100% rename from tests/res/parser/attrlist_0/10/e/20.py rename to tests/res/1/parser/attrlist_0/10/e/20.py diff --git a/tests/res/parser/attrlist_0/10/e/30.py b/tests/res/1/parser/attrlist_0/10/e/30.py similarity index 100% rename from tests/res/parser/attrlist_0/10/e/30.py rename to tests/res/1/parser/attrlist_0/10/e/30.py diff --git a/tests/res/parser/attrlist_0/10/e/40.py b/tests/res/1/parser/attrlist_0/10/e/40.py similarity index 100% rename from tests/res/parser/attrlist_0/10/e/40.py rename to tests/res/1/parser/attrlist_0/10/e/40.py diff --git a/tests/res/single_load/basics/30/test_cases_with_explicit_parser_type_option.txt b/tests/res/1/parser/list/10/00.txt similarity index 100% rename from tests/res/single_load/basics/30/test_cases_with_explicit_parser_type_option.txt rename to tests/res/1/parser/list/10/00.txt diff --git a/tests/res/parser/list/10/10.txt b/tests/res/1/parser/list/10/10.txt similarity index 100% rename from tests/res/parser/list/10/10.txt rename to tests/res/1/parser/list/10/10.txt diff --git a/tests/res/parser/list/10/20.txt b/tests/res/1/parser/list/10/20.txt similarity index 100% rename from tests/res/parser/list/10/20.txt rename to tests/res/1/parser/list/10/20.txt diff --git a/tests/res/parser/list/10/30.txt b/tests/res/1/parser/list/10/30.txt similarity index 100% rename from tests/res/parser/list/10/30.txt rename to tests/res/1/parser/list/10/30.txt diff --git a/tests/res/parser/list/10/40.txt b/tests/res/1/parser/list/10/40.txt similarity index 100% rename from tests/res/parser/list/10/40.txt rename to tests/res/1/parser/list/10/40.txt diff --git a/tests/res/parser/list/10/50.txt b/tests/res/1/parser/list/10/50.txt similarity index 100% rename from tests/res/parser/list/10/50.txt rename to tests/res/1/parser/list/10/50.txt diff --git a/tests/res/parser/list/10/e/00.json b/tests/res/1/parser/list/10/e/00.json similarity index 100% rename from tests/res/parser/list/10/e/00.json rename to tests/res/1/parser/list/10/e/00.json diff --git a/tests/res/parser/list/10/e/10.json b/tests/res/1/parser/list/10/e/10.json similarity index 100% rename from tests/res/parser/list/10/e/10.json rename to tests/res/1/parser/list/10/e/10.json diff --git a/tests/res/parser/list/10/e/20.json b/tests/res/1/parser/list/10/e/20.json similarity index 100% rename from tests/res/parser/list/10/e/20.json rename to tests/res/1/parser/list/10/e/20.json diff --git a/tests/res/parser/list/10/e/30.json b/tests/res/1/parser/list/10/e/30.json similarity index 100% rename from tests/res/parser/list/10/e/30.json rename to tests/res/1/parser/list/10/e/30.json diff --git a/tests/res/parser/list/10/e/40.json b/tests/res/1/parser/list/10/e/40.json similarity index 100% rename from tests/res/parser/list/10/e/40.json rename to tests/res/1/parser/list/10/e/40.json diff --git a/tests/res/parser/list/10/e/50.json b/tests/res/1/parser/list/10/e/50.json similarity index 100% rename from tests/res/parser/list/10/e/50.json rename to tests/res/1/parser/list/10/e/50.json diff --git a/tests/res/parser/attrlist/10/e/00.json b/tests/res/1/parser/list/10/o/00.json similarity index 100% rename from tests/res/parser/attrlist/10/e/00.json rename to tests/res/1/parser/list/10/o/00.json diff --git a/tests/res/single_load/template/20/o/10.json b/tests/res/1/parser/list/10/o/10.json similarity index 100% rename from tests/res/single_load/template/20/o/10.json rename to tests/res/1/parser/list/10/o/10.json diff --git a/tests/res/single_load/template/20/o/20.json b/tests/res/1/parser/list/10/o/20.json similarity index 100% rename from tests/res/single_load/template/20/o/20.json rename to tests/res/1/parser/list/10/o/20.json diff --git a/tests/res/parser/list/10/o/40.json b/tests/res/1/parser/list/10/o/30.json similarity index 100% rename from tests/res/parser/list/10/o/40.json rename to tests/res/1/parser/list/10/o/30.json diff --git a/tests/res/1/parser/list/10/o/40.json b/tests/res/1/parser/list/10/o/40.json new file mode 120000 index 00000000..a9005a1b --- /dev/null +++ b/tests/res/1/parser/list/10/o/40.json @@ -0,0 +1 @@ +00.json \ No newline at end of file diff --git a/tests/res/parser/list/10/o/50.json b/tests/res/1/parser/list/10/o/50.json similarity index 100% rename from tests/res/parser/list/10/o/50.json rename to tests/res/1/parser/list/10/o/50.json diff --git a/tests/res/parser/parse/10/00.py b/tests/res/1/parser/parse/10/00.py similarity index 100% rename from tests/res/parser/parse/10/00.py rename to tests/res/1/parser/parse/10/00.py diff --git a/tests/res/parser/parse/10/10.txt b/tests/res/1/parser/parse/10/10.txt similarity index 100% rename from tests/res/parser/parse/10/10.txt rename to tests/res/1/parser/parse/10/10.txt diff --git a/tests/res/parser/parse/10/20.txt b/tests/res/1/parser/parse/10/20.txt similarity index 100% rename from tests/res/parser/parse/10/20.txt rename to tests/res/1/parser/parse/10/20.txt diff --git a/tests/res/parser/parse/10/30.txt b/tests/res/1/parser/parse/10/30.txt similarity index 100% rename from tests/res/parser/parse/10/30.txt rename to tests/res/1/parser/parse/10/30.txt diff --git a/tests/res/parser/parse/10/40.py b/tests/res/1/parser/parse/10/40.py similarity index 100% rename from tests/res/parser/parse/10/40.py rename to tests/res/1/parser/parse/10/40.py diff --git a/tests/res/parser/parse/10/50.py b/tests/res/1/parser/parse/10/50.py similarity index 100% rename from tests/res/parser/parse/10/50.py rename to tests/res/1/parser/parse/10/50.py diff --git a/tests/res/parser/parse/10/60.txt b/tests/res/1/parser/parse/10/60.txt similarity index 100% rename from tests/res/parser/parse/10/60.txt rename to tests/res/1/parser/parse/10/60.txt diff --git a/tests/res/parser/parse/10/70.txt b/tests/res/1/parser/parse/10/70.txt similarity index 100% rename from tests/res/parser/parse/10/70.txt rename to tests/res/1/parser/parse/10/70.txt diff --git a/tests/res/parser/parse/10/e b/tests/res/1/parser/parse/10/e similarity index 100% rename from tests/res/parser/parse/10/e rename to tests/res/1/parser/parse/10/e diff --git a/tests/res/parser/parse/20/20.txt b/tests/res/1/parser/parse/20/20.txt similarity index 100% rename from tests/res/parser/parse/20/20.txt rename to tests/res/1/parser/parse/20/20.txt diff --git a/tests/res/parser/parse/20/30.txt b/tests/res/1/parser/parse/20/30.txt similarity index 100% rename from tests/res/parser/parse/20/30.txt rename to tests/res/1/parser/parse/20/30.txt diff --git a/tests/res/parser/parse/20/40.txt b/tests/res/1/parser/parse/20/40.txt similarity index 100% rename from tests/res/parser/parse/20/40.txt rename to tests/res/1/parser/parse/20/40.txt diff --git a/tests/res/parser/parse/20/e b/tests/res/1/parser/parse/20/e similarity index 100% rename from tests/res/parser/parse/20/e rename to tests/res/1/parser/parse/20/e diff --git a/tests/res/parser/parse/30/10.txt b/tests/res/1/parser/parse/30/10.txt similarity index 100% rename from tests/res/parser/parse/30/10.txt rename to tests/res/1/parser/parse/30/10.txt diff --git a/tests/res/parser/parse/30/20.txt b/tests/res/1/parser/parse/30/20.txt similarity index 100% rename from tests/res/parser/parse/30/20.txt rename to tests/res/1/parser/parse/30/20.txt diff --git a/tests/res/parser/parse/30/30.txt b/tests/res/1/parser/parse/30/30.txt similarity index 100% rename from tests/res/parser/parse/30/30.txt rename to tests/res/1/parser/parse/30/30.txt diff --git a/tests/res/parser/parse/30/40.txt b/tests/res/1/parser/parse/30/40.txt similarity index 100% rename from tests/res/parser/parse/30/40.txt rename to tests/res/1/parser/parse/30/40.txt diff --git a/tests/res/parser/parse/30/e b/tests/res/1/parser/parse/30/e similarity index 100% rename from tests/res/parser/parse/30/e rename to tests/res/1/parser/parse/30/e diff --git a/tests/res/parser/single/10/00.py b/tests/res/1/parser/single/10/00.py similarity index 100% rename from tests/res/parser/single/10/00.py rename to tests/res/1/parser/single/10/00.py diff --git a/tests/res/parser/single/10/10.txt b/tests/res/1/parser/single/10/10.txt similarity index 100% rename from tests/res/parser/single/10/10.txt rename to tests/res/1/parser/single/10/10.txt diff --git a/tests/res/parser/single/10/20.txt b/tests/res/1/parser/single/10/20.txt similarity index 100% rename from tests/res/parser/single/10/20.txt rename to tests/res/1/parser/single/10/20.txt diff --git a/tests/res/parser/single/10/30.txt b/tests/res/1/parser/single/10/30.txt similarity index 100% rename from tests/res/parser/single/10/30.txt rename to tests/res/1/parser/single/10/30.txt diff --git a/tests/res/parser/single/10/40.py b/tests/res/1/parser/single/10/40.py similarity index 100% rename from tests/res/parser/single/10/40.py rename to tests/res/1/parser/single/10/40.py diff --git a/tests/res/parser/single/10/50.py b/tests/res/1/parser/single/10/50.py similarity index 100% rename from tests/res/parser/single/10/50.py rename to tests/res/1/parser/single/10/50.py diff --git a/tests/res/parser/single/10/60.txt b/tests/res/1/parser/single/10/60.txt similarity index 100% rename from tests/res/parser/single/10/60.txt rename to tests/res/1/parser/single/10/60.txt diff --git a/tests/res/parser/single/10/70.txt b/tests/res/1/parser/single/10/70.txt similarity index 100% rename from tests/res/parser/single/10/70.txt rename to tests/res/1/parser/single/10/70.txt diff --git a/tests/res/parser/single/10/e/00.py b/tests/res/1/parser/single/10/e/00.py similarity index 100% rename from tests/res/parser/single/10/e/00.py rename to tests/res/1/parser/single/10/e/00.py diff --git a/tests/res/parser/single/10/e/10.py b/tests/res/1/parser/single/10/e/10.py similarity index 100% rename from tests/res/parser/single/10/e/10.py rename to tests/res/1/parser/single/10/e/10.py diff --git a/tests/res/parser/single/10/e/20.py b/tests/res/1/parser/single/10/e/20.py similarity index 100% rename from tests/res/parser/single/10/e/20.py rename to tests/res/1/parser/single/10/e/20.py diff --git a/tests/res/parser/single/10/e/30.py b/tests/res/1/parser/single/10/e/30.py similarity index 100% rename from tests/res/parser/single/10/e/30.py rename to tests/res/1/parser/single/10/e/30.py diff --git a/tests/res/parser/single/10/e/40.py b/tests/res/1/parser/single/10/e/40.py similarity index 100% rename from tests/res/parser/single/10/e/40.py rename to tests/res/1/parser/single/10/e/40.py diff --git a/tests/res/parser/single/10/e/50.py b/tests/res/1/parser/single/10/e/50.py similarity index 100% rename from tests/res/parser/single/10/e/50.py rename to tests/res/1/parser/single/10/e/50.py diff --git a/tests/res/parser/single/10/e/60.py b/tests/res/1/parser/single/10/e/60.py similarity index 100% rename from tests/res/parser/single/10/e/60.py rename to tests/res/1/parser/single/10/e/60.py diff --git a/tests/res/parser/single/10/e/70.py b/tests/res/1/parser/single/10/e/70.py similarity index 100% rename from tests/res/parser/single/10/e/70.py rename to tests/res/1/parser/single/10/e/70.py diff --git a/tests/res/cli/errors/10/README.md b/tests/res/cli/errors/10/README.md deleted file mode 100644 index 8450131c..00000000 --- a/tests/res/cli/errors/10/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Test cases for anyconfig\_cli - -- 10.json + o/10.json: no args, no options -- 20.json + o/20.json: no args, an wrong option -- 30.json + o/30.json: an input with unknown file type, no options -- 40.json + o/40.json: an input with unknown file type, an -I (input type) option gives an unknown file type -- 50.json + o/50.json: an input with known file type, an -o option gives file with known file type and an -O (output type) option gives an unknown file type diff --git a/tests/res/cli/extra_options/10/README.md b/tests/res/cli/extra_options/10/README.md deleted file mode 100644 index 9a5f458e..00000000 --- a/tests/res/cli/extra_options/10/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Test cases for anyconfig\_cli - -- 10.json + o/10.json: a JSON input with '--extra-args ...' option to load and dump to a JSON output diff --git a/tests/res/cli/ignore_missing/10/README.md b/tests/res/cli/ignore_missing/10/README.md deleted file mode 100644 index 2fdffd29..00000000 --- a/tests/res/cli/ignore_missing/10/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Test cases for anyconfig\_cli - -- 10.json + o/10.json: an input (this input file will be replaced with a file doees not exist) with '--ignore-missing' and '-O json' options to load and dump a JSON data as a string diff --git a/tests/res/cli/multi_inputs/10/README.md b/tests/res/cli/multi_inputs/10/README.md deleted file mode 100644 index 9d2b8d6c..00000000 --- a/tests/res/cli/multi_inputs/10/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Test cases for anyconfig\_cli - -- {1,2,3}0.json + o/10.json: multi JSON inputs without any options to load, and dump to a JSON file without any options diff --git a/tests/res/cli/multi_inputs/10/i/10.json b/tests/res/cli/multi_inputs/10/i/10.json deleted file mode 100644 index 0fe9a9f8..00000000 --- a/tests/res/cli/multi_inputs/10/i/10.json +++ /dev/null @@ -1 +0,0 @@ -"*.json" diff --git a/tests/res/cli/multi_inputs/20/README.md b/tests/res/cli/multi_inputs/20/README.md deleted file mode 100644 index cb7fae73..00000000 --- a/tests/res/cli/multi_inputs/20/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Test cases for anyconfig\_cli - -- 10.json, 20.xml, 30.sh + o/10.json: multi type inputs without any options to load, and dump to a JSON file without any options diff --git a/tests/res/cli/multi_inputs/20/i/10.json b/tests/res/cli/multi_inputs/20/i/10.json deleted file mode 100644 index ebdfde7c..00000000 --- a/tests/res/cli/multi_inputs/20/i/10.json +++ /dev/null @@ -1 +0,0 @@ -"*0.*" diff --git a/tests/res/cli/schema/10/e/20.json b/tests/res/cli/schema/10/e/20.json deleted file mode 100644 index a5a80882..00000000 --- a/tests/res/cli/schema/10/e/20.json +++ /dev/null @@ -1 +0,0 @@ -{"exit_code_matches": false} diff --git a/tests/res/cli/schema/10/s/20.json b/tests/res/cli/schema/10/s/20.json deleted file mode 100644 index a1634127..00000000 --- a/tests/res/cli/schema/10/s/20.json +++ /dev/null @@ -1 +0,0 @@ -{"type": "object", "properties": {"name": {"type": "integer"}, "a": {"type": "string"}, "b": {"type": "object", "properties": {"b": {"type": "array", "items": {"type": "integer"}}, "c": {"type": "string"}}}}} diff --git a/tests/res/cli/schema_errors/10/README.md b/tests/res/cli/schema_errors/10/README.md deleted file mode 100644 index 47d3d0af..00000000 --- a/tests/res/cli/schema_errors/10/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Test cases for anyconfig\_cli - -- 10.json + o/10.json: An JSON input to load with "--validate" option without "--schema" option should cause an error. diff --git a/tests/res/cli/show/10/README.md b/tests/res/cli/show/10/README.md deleted file mode 100644 index 52549389..00000000 --- a/tests/res/cli/show/10/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Test cases for anyconfig\_cli - -- 10.json + o/10.json: no args, a '-h' option, help messages should be printed (see e/10.json) -- 20.json + o/20.json: no args, a '--help' option, help messages should be printed (see e/20.json) -- 30.json + o/30.json: no args, a '-L' option, parsers should be printed (see e/30.json) -- 40.json + o/40.json: no args, a '--list' option, parsers should be printed (see e/40.json) - diff --git a/tests/res/cli/show/20/README.md b/tests/res/cli/show/20/README.md deleted file mode 100644 index 486338b0..00000000 --- a/tests/res/cli/show/20/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Test cases for anyconfig\_cli - -- 10.json + o/10.json: no args with '-E' (load config from environment variables) option and a '-O josn' (JSON output type) option; it should print environment variables as a dict in JSON format -- 20.json + o/20.json: no args with '--env' (load config from environment variables) option and a '-O josn' (JSON output type) option; it should print environment variables as a dict in JSON format diff --git a/tests/res/cli/show_version/10/README.md b/tests/res/cli/show_version/10/README.md deleted file mode 100644 index f19e67da..00000000 --- a/tests/res/cli/show_version/10/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Test cases for anyconfig\_cli - -- 10.json + o/10.json: no args, a '--version' option diff --git a/tests/res/cli/single_input/10/README.md b/tests/res/cli/single_input/10/README.md deleted file mode 100644 index 79687fb6..00000000 --- a/tests/res/cli/single_input/10/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Test cases for anyconfig\_cli - -- 10.json + o/10.json: an input with known file type, without any options to load, and dump to a JSON file without any output options -- 20.conf + o/20.json: an input with unknown file type and an "-I json" option to load, and dump to a JSON file without any output options -- 30.json + o/30.json: an input with unknown file type and an "-I json" option to load, and dump to a JSON file without '.json' file extension with "-O json" option diff --git a/tests/res/cli/single_input/30/README.md b/tests/res/cli/single_input/30/README.md deleted file mode 100644 index 921e64d0..00000000 --- a/tests/res/cli/single_input/30/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Test cases for anyconfig\_cli - -- 10.json + o/10.json: an input with known file type with "--set a=2" option to load, and dump to the modified JSON file without any output options -- 20.conf + o/20.json: an input with known file type with "--set b.c=ccc" option to load, and dump to the modified JSON file without any output options diff --git a/tests/res/cli/single_input/40/README.md b/tests/res/cli/single_input/40/README.md deleted file mode 100644 index f7306bf0..00000000 --- a/tests/res/cli/single_input/40/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Test cases for anyconfig\_cli - -- 10.json + o/10.json: a JSON input with "--args ..." option to load, and dump to the modified JSON file without any output options diff --git a/tests/res/cli/single_input/50/README.md b/tests/res/cli/single_input/50/README.md deleted file mode 100644 index ee3052b9..00000000 --- a/tests/res/cli/single_input/50/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Test cases for anyconfig\_cli - -- 10.json + o/10.json: a JSON input with "--gen-schema" option to load, and dump to a JSON schema file without any output options diff --git a/tests/res/cli/single_input/50/r/10.json b/tests/res/cli/single_input/50/r/10.json deleted file mode 100644 index afd319ce..00000000 --- a/tests/res/cli/single_input/50/r/10.json +++ /dev/null @@ -1 +0,0 @@ -{"type": "object", "properties": {"name": {"type": "string"}, "a": {"type": "integer"}, "b": {"type": "object", "properties": {"b": {"type": "array", "items": {"type": "integer"}}, "c": {"type": "string"}}}}} \ No newline at end of file diff --git a/tests/res/cli/single_input_to_yaml_output/10/README.md b/tests/res/cli/single_input_to_yaml_output/10/README.md deleted file mode 100644 index 80fe4e8b..00000000 --- a/tests/res/cli/single_input_to_yaml_output/10/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Test cases for anyconfig\_cli - -- 10.json + o/10.json: a JSON input without any options to load, and dump to a YAML file without any options -- 20.json + o/20.json: a JSON input without any options to load, and dump to a YAML file with '-O yaml' option -- 30.yml + o/30.json: a YAML input without any options to load, and dump to a JSON file without any options -- 40.yml + o/40.json: a YAML input with '-I yaml' option to load, and dump to a JSON file without any options diff --git a/tests/res/cli/template/10/10.json b/tests/res/cli/template/10/10.json deleted file mode 120000 index fba3b9e4..00000000 --- a/tests/res/cli/template/10/10.json +++ /dev/null @@ -1 +0,0 @@ -../../single_input/10/10.json \ No newline at end of file diff --git a/tests/res/dump/basics/10/00.json b/tests/res/dump/basics/10/00.json deleted file mode 120000 index b8e5136c..00000000 --- a/tests/res/dump/basics/10/00.json +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/00.json \ No newline at end of file diff --git a/tests/res/dump/basics/10/10.json b/tests/res/dump/basics/10/10.json deleted file mode 120000 index b8c4d11c..00000000 --- a/tests/res/dump/basics/10/10.json +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/10.json \ No newline at end of file diff --git a/tests/res/dump/basics/10/20.json b/tests/res/dump/basics/10/20.json deleted file mode 120000 index 374a2983..00000000 --- a/tests/res/dump/basics/10/20.json +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/20.json \ No newline at end of file diff --git a/tests/res/dump/basics/20/00.json b/tests/res/dump/basics/20/00.json deleted file mode 120000 index b8e5136c..00000000 --- a/tests/res/dump/basics/20/00.json +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/00.json \ No newline at end of file diff --git a/tests/res/dump/basics/20/10.json b/tests/res/dump/basics/20/10.json deleted file mode 120000 index b8c4d11c..00000000 --- a/tests/res/dump/basics/20/10.json +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/10.json \ No newline at end of file diff --git a/tests/res/dump/basics/20/20.json b/tests/res/dump/basics/20/20.json deleted file mode 120000 index 374a2983..00000000 --- a/tests/res/dump/basics/20/20.json +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/20.json \ No newline at end of file diff --git a/tests/res/dump/basics/20/o/00.json b/tests/res/dump/basics/20/o/00.json deleted file mode 100644 index 3726331a..00000000 --- a/tests/res/dump/basics/20/o/00.json +++ /dev/null @@ -1 +0,0 @@ -{"indent": 2} diff --git a/tests/res/dumps/basics/10/00.json b/tests/res/dumps/basics/10/00.json deleted file mode 120000 index b8e5136c..00000000 --- a/tests/res/dumps/basics/10/00.json +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/00.json \ No newline at end of file diff --git a/tests/res/dumps/basics/10/10.json b/tests/res/dumps/basics/10/10.json deleted file mode 120000 index b8c4d11c..00000000 --- a/tests/res/dumps/basics/10/10.json +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/10.json \ No newline at end of file diff --git a/tests/res/dumps/basics/10/20.json b/tests/res/dumps/basics/10/20.json deleted file mode 120000 index 374a2983..00000000 --- a/tests/res/dumps/basics/10/20.json +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/20.json \ No newline at end of file diff --git a/tests/res/dumps/basics/10/e/00.txt b/tests/res/dumps/basics/10/e/00.txt deleted file mode 120000 index a5f954a8..00000000 --- a/tests/res/dumps/basics/10/e/00.txt +++ /dev/null @@ -1 +0,0 @@ -../00.json \ No newline at end of file diff --git a/tests/res/dumps/basics/10/e/10.txt b/tests/res/dumps/basics/10/e/10.txt deleted file mode 120000 index 0cdec646..00000000 --- a/tests/res/dumps/basics/10/e/10.txt +++ /dev/null @@ -1 +0,0 @@ -../10.json \ No newline at end of file diff --git a/tests/res/dumps/basics/10/e/20.txt b/tests/res/dumps/basics/10/e/20.txt deleted file mode 120000 index b1858408..00000000 --- a/tests/res/dumps/basics/10/e/20.txt +++ /dev/null @@ -1 +0,0 @@ -../20.json \ No newline at end of file diff --git a/tests/res/dumps/basics/20/00.json b/tests/res/dumps/basics/20/00.json deleted file mode 120000 index b8e5136c..00000000 --- a/tests/res/dumps/basics/20/00.json +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/00.json \ No newline at end of file diff --git a/tests/res/dumps/basics/20/10.json b/tests/res/dumps/basics/20/10.json deleted file mode 120000 index b8c4d11c..00000000 --- a/tests/res/dumps/basics/20/10.json +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/10.json \ No newline at end of file diff --git a/tests/res/dumps/basics/20/20.json b/tests/res/dumps/basics/20/20.json deleted file mode 120000 index 374a2983..00000000 --- a/tests/res/dumps/basics/20/20.json +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/20.json \ No newline at end of file diff --git a/tests/res/dumps/basics/20/e/00.txt b/tests/res/dumps/basics/20/e/00.txt deleted file mode 120000 index 26187011..00000000 --- a/tests/res/dumps/basics/20/e/00.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../dump/basics/20/e/00.txt \ No newline at end of file diff --git a/tests/res/dumps/basics/20/e/10.txt b/tests/res/dumps/basics/20/e/10.txt deleted file mode 120000 index d6475418..00000000 --- a/tests/res/dumps/basics/20/e/10.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../dump/basics/20/e/10.txt \ No newline at end of file diff --git a/tests/res/dumps/basics/20/e/20.txt b/tests/res/dumps/basics/20/e/20.txt deleted file mode 120000 index 3337beb2..00000000 --- a/tests/res/dumps/basics/20/e/20.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../dump/basics/20/e/20.txt \ No newline at end of file diff --git a/tests/res/json/primitives/e/20.txt b/tests/res/json/primitives/e/20.txt deleted file mode 100644 index 0ca95142..00000000 --- a/tests/res/json/primitives/e/20.txt +++ /dev/null @@ -1 +0,0 @@ -True diff --git a/tests/res/json/query/00_00.json b/tests/res/json/query/00_00.json deleted file mode 120000 index d7f8c47d..00000000 --- a/tests/res/json/query/00_00.json +++ /dev/null @@ -1 +0,0 @@ -../basic/00.json \ No newline at end of file diff --git a/tests/res/json/query/00_10.json b/tests/res/json/query/00_10.json deleted file mode 120000 index d7f8c47d..00000000 --- a/tests/res/json/query/00_10.json +++ /dev/null @@ -1 +0,0 @@ -../basic/00.json \ No newline at end of file diff --git a/tests/res/json/query/10_00.json b/tests/res/json/query/10_00.json deleted file mode 120000 index 4ff165d3..00000000 --- a/tests/res/json/query/10_00.json +++ /dev/null @@ -1 +0,0 @@ -../basic/10.json \ No newline at end of file diff --git a/tests/res/json/query/10_10.json b/tests/res/json/query/10_10.json deleted file mode 120000 index 4ff165d3..00000000 --- a/tests/res/json/query/10_10.json +++ /dev/null @@ -1 +0,0 @@ -../basic/10.json \ No newline at end of file diff --git a/tests/res/json/query/10_20.json b/tests/res/json/query/10_20.json deleted file mode 120000 index 4ff165d3..00000000 --- a/tests/res/json/query/10_20.json +++ /dev/null @@ -1 +0,0 @@ -../basic/10.json \ No newline at end of file diff --git a/tests/res/json/query/10_30.json b/tests/res/json/query/10_30.json deleted file mode 120000 index 4ff165d3..00000000 --- a/tests/res/json/query/10_30.json +++ /dev/null @@ -1 +0,0 @@ -../basic/10.json \ No newline at end of file diff --git a/tests/res/json/query/10_40.json b/tests/res/json/query/10_40.json deleted file mode 120000 index 4ff165d3..00000000 --- a/tests/res/json/query/10_40.json +++ /dev/null @@ -1 +0,0 @@ -../basic/10.json \ No newline at end of file diff --git a/tests/res/json/query/20_00.json b/tests/res/json/query/20_00.json deleted file mode 120000 index e7ad7c92..00000000 --- a/tests/res/json/query/20_00.json +++ /dev/null @@ -1 +0,0 @@ -../basic/20.json \ No newline at end of file diff --git a/tests/res/json/query/20_10.json b/tests/res/json/query/20_10.json deleted file mode 120000 index e7ad7c92..00000000 --- a/tests/res/json/query/20_10.json +++ /dev/null @@ -1 +0,0 @@ -../basic/20.json \ No newline at end of file diff --git a/tests/res/json/query/20_20.json b/tests/res/json/query/20_20.json deleted file mode 120000 index e7ad7c92..00000000 --- a/tests/res/json/query/20_20.json +++ /dev/null @@ -1 +0,0 @@ -../basic/20.json \ No newline at end of file diff --git a/tests/res/json/template/10.json b/tests/res/json/template/10.json deleted file mode 100644 index 727d14d4..00000000 --- a/tests/res/json/template/10.json +++ /dev/null @@ -1 +0,0 @@ -{"a": 1, "b": {"b": [{{ b.b | join(',') }}], "c": "{{ b.c }}"}} diff --git a/tests/res/json/template/20.json b/tests/res/json/template/20.json deleted file mode 100644 index e417e5eb..00000000 --- a/tests/res/json/template/20.json +++ /dev/null @@ -1 +0,0 @@ -{"a": 1, "b": {"b": [{{ b.b | join(',') }}], "c": "{{ b.c }}", "d": true}, "e": null, "name": "aaa"} diff --git a/tests/res/json/template/ctx/00.json b/tests/res/json/template/ctx/00.json deleted file mode 120000 index d76dca3d..00000000 --- a/tests/res/json/template/ctx/00.json +++ /dev/null @@ -1 +0,0 @@ -../../basic/00.json \ No newline at end of file diff --git a/tests/res/json/template/ctx/10.json b/tests/res/json/template/ctx/10.json deleted file mode 120000 index 6b6103f0..00000000 --- a/tests/res/json/template/ctx/10.json +++ /dev/null @@ -1 +0,0 @@ -../../basic/10.json \ No newline at end of file diff --git a/tests/res/json/template/ctx/20.json b/tests/res/json/template/ctx/20.json deleted file mode 120000 index 3cebc88d..00000000 --- a/tests/res/json/template/ctx/20.json +++ /dev/null @@ -1 +0,0 @@ -../../basic/20.json \ No newline at end of file diff --git a/tests/res/json/template/e/00.json b/tests/res/json/template/e/00.json deleted file mode 120000 index c7bc0ee3..00000000 --- a/tests/res/json/template/e/00.json +++ /dev/null @@ -1 +0,0 @@ -../ctx/00.json \ No newline at end of file diff --git a/tests/res/json/template/e/10.json b/tests/res/json/template/e/10.json deleted file mode 100644 index 7e44a95c..00000000 --- a/tests/res/json/template/e/10.json +++ /dev/null @@ -1 +0,0 @@ -{"a": 1, "b": {"b": [1, 2], "c": "C"}} diff --git a/tests/res/json/template/e/20.json b/tests/res/json/template/e/20.json deleted file mode 120000 index 5bbb0070..00000000 --- a/tests/res/json/template/e/20.json +++ /dev/null @@ -1 +0,0 @@ -../ctx/20.json \ No newline at end of file diff --git a/tests/res/loads/basics/10/00.txt b/tests/res/loads/basics/10/00.txt deleted file mode 120000 index b8e5136c..00000000 --- a/tests/res/loads/basics/10/00.txt +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/00.json \ No newline at end of file diff --git a/tests/res/loads/basics/10/10.txt b/tests/res/loads/basics/10/10.txt deleted file mode 120000 index b8c4d11c..00000000 --- a/tests/res/loads/basics/10/10.txt +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/10.json \ No newline at end of file diff --git a/tests/res/loads/basics/10/20.txt b/tests/res/loads/basics/10/20.txt deleted file mode 120000 index 374a2983..00000000 --- a/tests/res/loads/basics/10/20.txt +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/20.json \ No newline at end of file diff --git a/tests/res/loads/query/10/00_00.txt b/tests/res/loads/query/10/00_00.txt deleted file mode 120000 index 50a2bc6c..00000000 --- a/tests/res/loads/query/10/00_00.txt +++ /dev/null @@ -1 +0,0 @@ -../../../json/query/00_00.json \ No newline at end of file diff --git a/tests/res/loads/query/10/00_10.txt b/tests/res/loads/query/10/00_10.txt deleted file mode 120000 index 55252a92..00000000 --- a/tests/res/loads/query/10/00_10.txt +++ /dev/null @@ -1 +0,0 @@ -../../../json/query/00_10.json \ No newline at end of file diff --git a/tests/res/loads/query/10/10_00.txt b/tests/res/loads/query/10/10_00.txt deleted file mode 120000 index 4daf3acc..00000000 --- a/tests/res/loads/query/10/10_00.txt +++ /dev/null @@ -1 +0,0 @@ -../../../json/query/10_00.json \ No newline at end of file diff --git a/tests/res/loads/query/10/10_10.txt b/tests/res/loads/query/10/10_10.txt deleted file mode 120000 index 34f9433b..00000000 --- a/tests/res/loads/query/10/10_10.txt +++ /dev/null @@ -1 +0,0 @@ -../../../json/query/10_10.json \ No newline at end of file diff --git a/tests/res/loads/query/10/10_20.txt b/tests/res/loads/query/10/10_20.txt deleted file mode 120000 index f142b7cd..00000000 --- a/tests/res/loads/query/10/10_20.txt +++ /dev/null @@ -1 +0,0 @@ -../../../json/query/10_20.json \ No newline at end of file diff --git a/tests/res/loads/query/10/10_30.txt b/tests/res/loads/query/10/10_30.txt deleted file mode 120000 index bbbaf3de..00000000 --- a/tests/res/loads/query/10/10_30.txt +++ /dev/null @@ -1 +0,0 @@ -../../../json/query/10_30.json \ No newline at end of file diff --git a/tests/res/loads/query/10/10_40.txt b/tests/res/loads/query/10/10_40.txt deleted file mode 120000 index e9800dff..00000000 --- a/tests/res/loads/query/10/10_40.txt +++ /dev/null @@ -1 +0,0 @@ -../../../json/query/10_40.json \ No newline at end of file diff --git a/tests/res/loads/query/10/20_00.txt b/tests/res/loads/query/10/20_00.txt deleted file mode 120000 index 3bc60a8d..00000000 --- a/tests/res/loads/query/10/20_00.txt +++ /dev/null @@ -1 +0,0 @@ -../../../json/query/20_00.json \ No newline at end of file diff --git a/tests/res/loads/query/10/20_10.txt b/tests/res/loads/query/10/20_10.txt deleted file mode 120000 index d38cc55b..00000000 --- a/tests/res/loads/query/10/20_10.txt +++ /dev/null @@ -1 +0,0 @@ -../../../json/query/20_10.json \ No newline at end of file diff --git a/tests/res/loads/query/10/20_20.txt b/tests/res/loads/query/10/20_20.txt deleted file mode 120000 index 45716ff5..00000000 --- a/tests/res/loads/query/10/20_20.txt +++ /dev/null @@ -1 +0,0 @@ -../../../json/query/20_20.json \ No newline at end of file diff --git a/tests/res/loads/query/10/e b/tests/res/loads/query/10/e deleted file mode 120000 index d1af22eb..00000000 --- a/tests/res/loads/query/10/e +++ /dev/null @@ -1 +0,0 @@ -../../../json/query/e \ No newline at end of file diff --git a/tests/res/loads/query/10/q b/tests/res/loads/query/10/q deleted file mode 120000 index 97115cee..00000000 --- a/tests/res/loads/query/10/q +++ /dev/null @@ -1 +0,0 @@ -../../../json/query/q \ No newline at end of file diff --git a/tests/res/loads/schema/10/00.txt b/tests/res/loads/schema/10/00.txt deleted file mode 120000 index b8e5136c..00000000 --- a/tests/res/loads/schema/10/00.txt +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/00.json \ No newline at end of file diff --git a/tests/res/loads/schema/10/10.txt b/tests/res/loads/schema/10/10.txt deleted file mode 120000 index b8c4d11c..00000000 --- a/tests/res/loads/schema/10/10.txt +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/10.json \ No newline at end of file diff --git a/tests/res/loads/schema/10/20.txt b/tests/res/loads/schema/10/20.txt deleted file mode 120000 index 374a2983..00000000 --- a/tests/res/loads/schema/10/20.txt +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/20.json \ No newline at end of file diff --git a/tests/res/loads/schema/10/s/00.txt b/tests/res/loads/schema/10/s/00.txt deleted file mode 120000 index a5f74b0a..00000000 --- a/tests/res/loads/schema/10/s/00.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../base/basics/10/s/00.json \ No newline at end of file diff --git a/tests/res/loads/schema/10/s/10.txt b/tests/res/loads/schema/10/s/10.txt deleted file mode 120000 index 22496a9f..00000000 --- a/tests/res/loads/schema/10/s/10.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../base/basics/10/s/10.json \ No newline at end of file diff --git a/tests/res/loads/schema/10/s/20.txt b/tests/res/loads/schema/10/s/20.txt deleted file mode 120000 index 74c954b1..00000000 --- a/tests/res/loads/schema/10/s/20.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../base/basics/10/s/20.json \ No newline at end of file diff --git a/tests/res/loads/template/10/00.txt b/tests/res/loads/template/10/00.txt deleted file mode 120000 index ca42c775..00000000 --- a/tests/res/loads/template/10/00.txt +++ /dev/null @@ -1 +0,0 @@ -../../../json/template/00.json \ No newline at end of file diff --git a/tests/res/loads/template/10/10.txt b/tests/res/loads/template/10/10.txt deleted file mode 120000 index 9ea6be1d..00000000 --- a/tests/res/loads/template/10/10.txt +++ /dev/null @@ -1 +0,0 @@ -../../../json/template/10.json \ No newline at end of file diff --git a/tests/res/loads/template/10/20.txt b/tests/res/loads/template/10/20.txt deleted file mode 120000 index c14c6cc1..00000000 --- a/tests/res/loads/template/10/20.txt +++ /dev/null @@ -1 +0,0 @@ -../../../json/template/20.json \ No newline at end of file diff --git a/tests/res/loads/template/10/c b/tests/res/loads/template/10/c deleted file mode 120000 index cb440095..00000000 --- a/tests/res/loads/template/10/c +++ /dev/null @@ -1 +0,0 @@ -../../../base/basics/10/c \ No newline at end of file diff --git a/tests/res/loads/template/10/e b/tests/res/loads/template/10/e deleted file mode 120000 index cba86d3d..00000000 --- a/tests/res/loads/template/10/e +++ /dev/null @@ -1 +0,0 @@ -../../../json/template/e \ No newline at end of file diff --git a/tests/res/multi_load/basics/00/s/00.json b/tests/res/multi_load/basics/00/s/00.json deleted file mode 120000 index 74c954b1..00000000 --- a/tests/res/multi_load/basics/00/s/00.json +++ /dev/null @@ -1 +0,0 @@ -../../../../base/basics/10/s/20.json \ No newline at end of file diff --git a/tests/res/multi_load/query/00_00/e/exp.json b/tests/res/multi_load/query/00_00/e/exp.json deleted file mode 120000 index 9cbbedfa..00000000 --- a/tests/res/multi_load/query/00_00/e/exp.json +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/e/00_00.json \ No newline at end of file diff --git a/tests/res/multi_load/query/00_00/q/q.txt b/tests/res/multi_load/query/00_00/q/q.txt deleted file mode 120000 index b19e4dc2..00000000 --- a/tests/res/multi_load/query/00_00/q/q.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/q/00_00.txt \ No newline at end of file diff --git a/tests/res/multi_load/query/00_10/e/exp.json b/tests/res/multi_load/query/00_10/e/exp.json deleted file mode 120000 index ddd4fe1a..00000000 --- a/tests/res/multi_load/query/00_10/e/exp.json +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/e/00_10.json \ No newline at end of file diff --git a/tests/res/multi_load/query/00_10/q/q.txt b/tests/res/multi_load/query/00_10/q/q.txt deleted file mode 120000 index d6b83fb2..00000000 --- a/tests/res/multi_load/query/00_10/q/q.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/q/00_10.txt \ No newline at end of file diff --git a/tests/res/multi_load/query/10_10/e/exp.json b/tests/res/multi_load/query/10_10/e/exp.json deleted file mode 120000 index 7fe51ec1..00000000 --- a/tests/res/multi_load/query/10_10/e/exp.json +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/e/10_10.json \ No newline at end of file diff --git a/tests/res/multi_load/query/10_10/q/q.txt b/tests/res/multi_load/query/10_10/q/q.txt deleted file mode 120000 index f4e6f0c8..00000000 --- a/tests/res/multi_load/query/10_10/q/q.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/q/10_10.txt \ No newline at end of file diff --git a/tests/res/multi_load/query/10_20/q/q.txt b/tests/res/multi_load/query/10_20/q/q.txt deleted file mode 120000 index 90b4cabd..00000000 --- a/tests/res/multi_load/query/10_20/q/q.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/q/10_20.txt \ No newline at end of file diff --git a/tests/res/multi_load/query/10_30/e/exp.json b/tests/res/multi_load/query/10_30/e/exp.json deleted file mode 120000 index 343f4da9..00000000 --- a/tests/res/multi_load/query/10_30/e/exp.json +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/e/10_30.json \ No newline at end of file diff --git a/tests/res/multi_load/query/10_30/q/q.txt b/tests/res/multi_load/query/10_30/q/q.txt deleted file mode 120000 index f8fb052f..00000000 --- a/tests/res/multi_load/query/10_30/q/q.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/q/10_30.txt \ No newline at end of file diff --git a/tests/res/multi_load/query/10_40/e/exp.json b/tests/res/multi_load/query/10_40/e/exp.json deleted file mode 120000 index 3ba11484..00000000 --- a/tests/res/multi_load/query/10_40/e/exp.json +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/e/10_40.json \ No newline at end of file diff --git a/tests/res/multi_load/query/10_40/q/q.txt b/tests/res/multi_load/query/10_40/q/q.txt deleted file mode 120000 index ecce312a..00000000 --- a/tests/res/multi_load/query/10_40/q/q.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/q/10_40.txt \ No newline at end of file diff --git a/tests/res/multi_load/query/10_50/e/exp.json b/tests/res/multi_load/query/10_50/e/exp.json deleted file mode 120000 index 7cbabf97..00000000 --- a/tests/res/multi_load/query/10_50/e/exp.json +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/e/10_50.json \ No newline at end of file diff --git a/tests/res/multi_load/query/10_50/q/q.txt b/tests/res/multi_load/query/10_50/q/q.txt deleted file mode 120000 index 63dc4377..00000000 --- a/tests/res/multi_load/query/10_50/q/q.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/q/10_50.txt \ No newline at end of file diff --git a/tests/res/multi_load/query/20_00/e/exp.json b/tests/res/multi_load/query/20_00/e/exp.json deleted file mode 120000 index d83df4e7..00000000 --- a/tests/res/multi_load/query/20_00/e/exp.json +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/e/20_00.json \ No newline at end of file diff --git a/tests/res/multi_load/query/20_00/q/q.txt b/tests/res/multi_load/query/20_00/q/q.txt deleted file mode 120000 index 57a2facd..00000000 --- a/tests/res/multi_load/query/20_00/q/q.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/q/20_00.txt \ No newline at end of file diff --git a/tests/res/multi_load/query/20_10/e/exp.json b/tests/res/multi_load/query/20_10/e/exp.json deleted file mode 120000 index ae7149d0..00000000 --- a/tests/res/multi_load/query/20_10/e/exp.json +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/e/20_10.json \ No newline at end of file diff --git a/tests/res/multi_load/query/20_10/q/q.txt b/tests/res/multi_load/query/20_10/q/q.txt deleted file mode 120000 index b413e52e..00000000 --- a/tests/res/multi_load/query/20_10/q/q.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/q/20_10.txt \ No newline at end of file diff --git a/tests/res/multi_load/query/20_20/e/exp.json b/tests/res/multi_load/query/20_20/e/exp.json deleted file mode 120000 index 0abb6ad0..00000000 --- a/tests/res/multi_load/query/20_20/e/exp.json +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/e/20_20.json \ No newline at end of file diff --git a/tests/res/multi_load/query/20_20/q/q.txt b/tests/res/multi_load/query/20_20/q/q.txt deleted file mode 120000 index 30d01047..00000000 --- a/tests/res/multi_load/query/20_20/q/q.txt +++ /dev/null @@ -1 +0,0 @@ -../../../../json/query/q/20_20.txt \ No newline at end of file diff --git a/tests/res/multi_load/template/10/00.json b/tests/res/multi_load/template/10/00.json deleted file mode 100644 index c0088f0f..00000000 --- a/tests/res/multi_load/template/10/00.json +++ /dev/null @@ -1 +0,0 @@ -{"a": {{ a }}} diff --git a/tests/res/multi_load/template/10/e/exp.json b/tests/res/multi_load/template/10/e/exp.json deleted file mode 100644 index 8bf358af..00000000 --- a/tests/res/multi_load/template/10/e/exp.json +++ /dev/null @@ -1 +0,0 @@ -{"a": 1, "b": {"b": [1, 2], "c": "C", "d": true}, "e": null, "name": "aaa"} diff --git a/tests/res/open/basics/10 b/tests/res/open/basics/10 deleted file mode 120000 index 9aabe51d..00000000 --- a/tests/res/open/basics/10 +++ /dev/null @@ -1 +0,0 @@ -../../base/basics/10 \ No newline at end of file diff --git a/tests/res/parser/list/10/o/00.json b/tests/res/parser/list/10/o/00.json deleted file mode 100644 index 0967ef42..00000000 --- a/tests/res/parser/list/10/o/00.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/tests/res/single_load/multi_types/20/10.sh b/tests/res/single_load/multi_types/20/10.sh deleted file mode 100644 index 7fb3d32e..00000000 --- a/tests/res/single_load/multi_types/20/10.sh +++ /dev/null @@ -1,5 +0,0 @@ -a=0 -b='bbb' # a comment -c="ccc" # an another comment -export d='ddd' ## double comment - export e="eee" ### tripple comment diff --git a/tests/res/single_load/multi_types/20/e/10.json b/tests/res/single_load/multi_types/20/e/10.json deleted file mode 100644 index bc2aea07..00000000 --- a/tests/res/single_load/multi_types/20/e/10.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "a": "0", - "b": "bbb", - "c": "ccc", - "d": "ddd", - "e": "eee" -} - diff --git a/tests/res/single_load/primitives/10/40.json b/tests/res/single_load/primitives/10/40.json deleted file mode 100644 index 44e2ace7..00000000 --- a/tests/res/single_load/primitives/10/40.json +++ /dev/null @@ -1 +0,0 @@ -[1, 2] diff --git a/tests/res/single_load/query/10/e/10_00.json b/tests/res/single_load/query/10/e/10_00.json deleted file mode 120000 index 4060f79c..00000000 --- a/tests/res/single_load/query/10/e/10_00.json +++ /dev/null @@ -1 +0,0 @@ -00_00.json \ No newline at end of file diff --git a/tests/res/single_load/query/10/e/10_10.json b/tests/res/single_load/query/10/e/10_10.json deleted file mode 120000 index 5d400961..00000000 --- a/tests/res/single_load/query/10/e/10_10.json +++ /dev/null @@ -1 +0,0 @@ -00_10.json \ No newline at end of file diff --git a/tests/res/single_load/query/10/e/10_20.json b/tests/res/single_load/query/10/e/10_20.json deleted file mode 100644 index 5d5dd706..00000000 --- a/tests/res/single_load/query/10/e/10_20.json +++ /dev/null @@ -1 +0,0 @@ - {"b": [1, 2], "c": "C"} diff --git a/tests/res/single_load/query/10/e/10_30.json b/tests/res/single_load/query/10/e/10_30.json deleted file mode 100644 index 44e2ace7..00000000 --- a/tests/res/single_load/query/10/e/10_30.json +++ /dev/null @@ -1 +0,0 @@ -[1, 2] diff --git a/tests/res/single_load/query/10/e/10_50.json b/tests/res/single_load/query/10/e/10_50.json deleted file mode 100644 index d00491fd..00000000 --- a/tests/res/single_load/query/10/e/10_50.json +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/tests/res/single_load/query/10/e/20_10.json b/tests/res/single_load/query/10/e/20_10.json deleted file mode 100644 index 27ba77dd..00000000 --- a/tests/res/single_load/query/10/e/20_10.json +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/tests/res/single_load/query/10/q/00_10.txt b/tests/res/single_load/query/10/q/00_10.txt deleted file mode 100644 index 231f150c..00000000 --- a/tests/res/single_load/query/10/q/00_10.txt +++ /dev/null @@ -1 +0,0 @@ -"a" diff --git a/tests/res/single_load/query/10/q/10_00.txt b/tests/res/single_load/query/10/q/10_00.txt deleted file mode 120000 index de123e01..00000000 --- a/tests/res/single_load/query/10/q/10_00.txt +++ /dev/null @@ -1 +0,0 @@ -00_00.txt \ No newline at end of file diff --git a/tests/res/single_load/query/10/q/10_10.txt b/tests/res/single_load/query/10/q/10_10.txt deleted file mode 120000 index 5d848c8d..00000000 --- a/tests/res/single_load/query/10/q/10_10.txt +++ /dev/null @@ -1 +0,0 @@ -00_10.txt \ No newline at end of file diff --git a/tests/res/single_load/query/10/q/20_00.txt b/tests/res/single_load/query/10/q/20_00.txt deleted file mode 120000 index de123e01..00000000 --- a/tests/res/single_load/query/10/q/20_00.txt +++ /dev/null @@ -1 +0,0 @@ -00_00.txt \ No newline at end of file diff --git a/tests/res/single_load/schema/10/s/00.json b/tests/res/single_load/schema/10/s/00.json deleted file mode 100644 index 2f14ca5e..00000000 --- a/tests/res/single_load/schema/10/s/00.json +++ /dev/null @@ -1 +0,0 @@ -{"type": "object", "properties": {"a": {"type": "integer"}}} \ No newline at end of file diff --git a/tests/res/single_load/schema/10/s/10.json b/tests/res/single_load/schema/10/s/10.json deleted file mode 100644 index 39e56c62..00000000 --- a/tests/res/single_load/schema/10/s/10.json +++ /dev/null @@ -1 +0,0 @@ -{"type": "object", "properties": {"a": {"type": "integer"}, "b": {"type": "object", "properties": {"b": {"type": "array", "items": {"type": "integer"}}, "c": {"type": "string"}}}, "name": {"type": "string"}}} \ No newline at end of file diff --git a/tests/res/single_load/yaml/10/e/00.json b/tests/res/single_load/yaml/10/e/00.json deleted file mode 100644 index cb5b2f69..00000000 --- a/tests/res/single_load/yaml/10/e/00.json +++ /dev/null @@ -1 +0,0 @@ -{"a": 1} diff --git a/tests/res/single_load/yaml/10/e/10.json b/tests/res/single_load/yaml/10/e/10.json deleted file mode 100644 index 8c08088a..00000000 --- a/tests/res/single_load/yaml/10/e/10.json +++ /dev/null @@ -1 +0,0 @@ -{"a": 1, "b": {"b": [1, 2], "c": "C"}, "name": "aaa"} diff --git a/tests/template/test_jinja2.py b/tests/template/test_jinja2.py index 3f9000bf..3c1b087d 100644 --- a/tests/template/test_jinja2.py +++ b/tests/template/test_jinja2.py @@ -1,18 +1,23 @@ # -# Copyright (C) 2015 - 2021 Satoru SATOH +# Copyright (C) 2015 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring, unused-variable, invalid-name +# pylint: disable=missing-docstring +from __future__ import annotations + import os import pathlib -import tempfile -import unittest import unittest.mock +import pytest + try: import anyconfig.template.jinja2 as TT except ImportError: - raise unittest.SkipTest("jinja2 does not look available.") + pytest.skip( + "jinja2 does not look available.", + allow_module_level=True + ) from .. import base @@ -39,89 +44,79 @@ def negate(value): return - value -class FunctionsTestCase(unittest.TestCase): - - def test_make_template_paths(self): - tpath0 = pathlib.Path("/path/to/a/").resolve() - path0 = tpath0 / "tmpl.j2" - tmp0 = pathlib.Path("/tmp").resolve() - ies = (((path0, ), [tpath0]), - ((path0, [tmp0]), [tpath0, tmp0]), - ) - for inp, exp in ies: - self.assertEqual( - TT.make_template_paths(*inp), exp - ) - - def test_make_template_paths_after_chdir(self): - tmp0 = pathlib.Path("/tmp").resolve() - saved = pathlib.Path().cwd().resolve() - try: - os.chdir(str(tmp0)) - tpath1 = pathlib.Path(".") - path1 = tpath1 / "tmpl.j2" - ies = (((path1, ), [tmp0]), - ((path1, [tmp0]), [tmp0]), - ) - - for inp, exp in ies: - self.assertEqual( - TT.make_template_paths(*inp), exp - ) - except FileNotFoundError: - pass # ``tmp0`` does not exist on windows. - finally: - os.chdir(str(saved)) - - -class TestCase(unittest.TestCase): - - def assertAlmostEqual(self, inp, exp, **_kwargs): - """Override to allow to compare texts. - """ - self.assertEqual(normalize(inp), normalize(exp)) - - def test_render_impl_without_paths(self): - for inp, exp in TEMPLATES: - self.assertAlmostEqual(TT.render_impl(inp), exp) - - def test_render_impl_with_paths(self): - for inp, exp in TEMPLATES: - self.assertAlmostEqual( - TT.render_impl(inp, paths=[inp.parent]), exp - ) - - def test_render_without_paths(self): - for inp, exp in TEMPLATES: - self.assertAlmostEqual(TT.render(inp), exp) - - def test_render_with_wrong_path(self): - with tempfile.TemporaryDirectory() as tdir: - workdir = pathlib.Path(tdir) - - ng_t = workdir / "ng.j2" - ok_t = workdir / "ok.j2" - ok_t_content = "a: {{ a }}" - ok_content = "a: aaa" - ctx = dict(a="aaa", ) - - ok_t.write_text(ok_t_content) - - with unittest.mock.patch("builtins.input") as mock_input: - mock_input.return_value = str(ok_t) - c_r = TT.render(str(ng_t), ctx, ask=True) - self.assertEqual(c_r, ok_content) - - with self.assertRaises(TT.jinja2.TemplateNotFound): - TT.render(str(ng_t), ctx, ask=False) - - def test_try_render_with_empty_filepath_and_content(self): - self.assertRaises(ValueError, TT.try_render) - - def test_render_with_filter(self): - for inp, exp in TEMPLATES_WITH_FILTERS: - self.assertAlmostEqual( - TT.render(inp, filters={"negate": negate}), exp - ) - -# vim:sw=4:ts=4:et: +TMPL_DIR_10 = pathlib.Path("/path/to/a/").resolve() +TMPL_PATH_10 = TMPL_DIR_10 / "tmpl.j2" +TMP_DIR = pathlib.Path("/tmp").resolve() + + +@pytest.mark.parametrize( + ("args", "exp"), + (((TMPL_PATH_10, ), [TMPL_DIR_10]), + ((TMPL_PATH_10, [TMP_DIR]), [TMPL_DIR_10, TMP_DIR]), + ), +) +def test_make_template_paths(args, exp): + assert TT.make_template_paths(*args) == exp + + +def test_make_template_paths_after_chdir(tmp_path): + old_pwd = pathlib.Path().cwd().resolve() + path_1 = tmp_path / "t.j2" + + try: + os.chdir(str(tmp_path)) + + assert TT.make_template_paths(path_1) == [tmp_path] + assert TT.make_template_paths(path_1, [tmp_path]) == [tmp_path] + except FileNotFoundError: + pass # ``tmp0`` does not exist on windows. + finally: + os.chdir(str(old_pwd)) + + +def __assert_almost_eq(lhs, rhs): + assert normalize(lhs) == normalize(rhs) + + +@pytest.mark.parametrize(("tmpl", "exp"), TEMPLATES) +def test_render_impl_without_paths(tmpl, exp): + __assert_almost_eq(TT.render_impl(tmpl), exp) + + +@pytest.mark.parametrize(("tmpl", "exp"), TEMPLATES) +def test_render_impl_with_paths(tmpl, exp): + __assert_almost_eq(TT.render_impl(tmpl, paths=[tmpl.parent]), exp) + + +@pytest.mark.parametrize(("tmpl", "exp"), TEMPLATES) +def test_render_without_paths(tmpl, exp): + __assert_almost_eq(TT.render(tmpl), exp) + + +def test_try_render_with_empty_filepath_and_content(): + with pytest.raises(ValueError): + TT.try_render() + + +@pytest.mark.parametrize(("tmpl", "exp"), TEMPLATES_WITH_FILTERS) +def test_render_with_filter(tmpl, exp): + __assert_almost_eq(TT.render(tmpl, filters={"negate": negate}), exp) + + +def test_render_with_wrong_path(tmp_path): + workdir = tmp_path + + ng_t = workdir / "ng.j2" + ok_t = workdir / "ok.j2" + ok_t_content = "a: {{ a }}" + ok_content = "a: aaa" + ctx = {"a": "aaa"} + + ok_t.write_text(ok_t_content) + + with unittest.mock.patch("builtins.input") as mock_input: + mock_input.return_value = str(ok_t) + assert TT.render(str(ng_t), ctx, ask=True) == ok_content + + with pytest.raises(TT.jinja2.TemplateNotFound): + TT.render(str(ng_t), ctx, ask=False) diff --git a/tests/test_lib.py b/tests/test_lib.py index 0190b595..2d6c8eab 100644 --- a/tests/test_lib.py +++ b/tests/test_lib.py @@ -1,16 +1,13 @@ # -# Copyright (C) 2015 - 2021 Satoru SATOH +# Copyright (C) 2015 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring import pathlib import subprocess -import tempfile -import unittest -SCRIPT_TO_USE_ANYCONFIG = """\ -#! /usr/bin/env python +SCRIPT_TO_USE_ANYCONFIG = """#! /usr/bin/env python import anyconfig c = anyconfig.load("/") or {} @@ -23,19 +20,15 @@ def check_output(cmd): - devnull = open(NULL_DEV, "w") - proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=devnull) - return proc.communicate()[0] + with open(NULL_DEV, mode="w", encoding="utf-8") as devnull: + with subprocess.Popen(cmd, stdout=subprocess.PIPE, + stderr=devnull) as proc: + return proc.communicate()[0] -class TestCase(unittest.TestCase): +def test_run_script(tmp_path: pathlib.Path): + script = tmp_path / "a.py" + script.write_text(SCRIPT_TO_USE_ANYCONFIG) + out = check_output(["python", str(script)]) - def test_00_run_script(self): - with tempfile.TemporaryDirectory(prefix="anyconfig-tests-") as tmpdir: - script = pathlib.Path(tmpdir) / "a.py" - script.write_text(SCRIPT_TO_USE_ANYCONFIG) - - out = check_output(["python", str(script)]) - self.assertTrue(out in (b"", "")) - -# vim:sw=4:ts=4:et: + assert out in (b"", "") diff --git a/tests/test_singleton.py b/tests/test_singleton.py index 7ed0aaac..2088a5be 100644 --- a/tests/test_singleton.py +++ b/tests/test_singleton.py @@ -1,45 +1,44 @@ # -# Copyright (C) 2018 Satoru SATOH +# Copyright (C) 2018 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring, invalid-name, too-few-public-methods -import unittest +from __future__ import annotations + import anyconfig.singleton as TT -class TestSingleton(unittest.TestCase): +def test_basic_singletons() -> None: + class A(TT.Singleton): + pass - def test_10_basic(self): - class A(TT.Singleton): - pass + class B(TT.Singleton): + pass - class B(TT.Singleton): - pass + (a1, a2) = (A(), A()) + (b1, b2) = (B(), B()) + assert a1 is a2 + assert b1 is b2 + assert a1 is not b1 - (a1, a2) = (A(), A()) - (b1, b2) = (B(), B()) - self.assertTrue(a1 is a2) - self.assertTrue(b1 is b2) - self.assertTrue(a1 is not b1) - def test_20_descendant(self): - class A(TT.Singleton): - pass +def test_descendants() -> None: + class A(TT.Singleton): + pass - class A2(A): - pass + class A2(A): + pass - (a1, a2) = (A(), A2()) - self.assertTrue(a1 is a2) + (a1, a2) = (A(), A2()) + assert a1 is a2 - def test_30_mixin(self): - class Base: - pass - class A(Base, TT.Singleton): - pass +def test_mixins() -> None: + class Base: + pass - (a1, a2) = (A(), A()) - self.assertTrue(a1 is a2) + class A(Base, TT.Singleton): + pass -# vim:sw=4:ts=4:et: + (a1, a2) = (A(), A()) + assert a1 is a2 diff --git a/tests/utils/test_detectors.py b/tests/utils/test_detectors.py index 061de410..3b864117 100644 --- a/tests/utils/test_detectors.py +++ b/tests/utils/test_detectors.py @@ -4,6 +4,8 @@ # # pylint: disable=missing-docstring,invalid-name """test cases for anyconfig.utils.""" +from __future__ import annotations + import collections import pytest diff --git a/tests/utils/test_files.py b/tests/utils/test_files.py index 8307f6de..747cbb4d 100644 --- a/tests/utils/test_files.py +++ b/tests/utils/test_files.py @@ -1,39 +1,40 @@ # -# Copyright (C) 2012 - 2021 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -r"""Test cases for anyconfig.utils.files. -""" +r"""Test cases for anyconfig.utils.files.""" +from __future__ import annotations + import pathlib -import unittest +import typing -import anyconfig.utils.files as TT +import pytest +import anyconfig.utils.files as TT -class TestCase(unittest.TestCase): - def test_is_io_stream(self): - ies = ( - (open(__file__), True), - (__file__, False), - ([__file__], False), - (pathlib.Path(__file__), False), - ([pathlib.Path(__file__)], False), - ) - for inp, exp in ies: - res = TT.is_io_stream(inp) - (self.assertTrue if exp else self.assertFalse)(res) +@pytest.mark.parametrize( + ("obj", "exp"), + ((open(__file__, encoding="utf-8"), True), + (__file__, False), + ([__file__], False), + (pathlib.Path(__file__), False), + ([pathlib.Path(__file__)], False), + ), +) +def test_is_io_stream(obj: typing.Any, exp: bool) -> None: + res = TT.is_io_stream(obj) + assert res if exp else not res - def test_get_path_from_stream(self): - this = __file__ - with pathlib.Path(this).open() as strm: - self.assertEqual(TT.get_path_from_stream(strm), this) +def test_get_path_from_stream() -> None: + this = __file__ - with self.assertRaises(ValueError): - TT.get_path_from_stream(this) + with pathlib.Path(this).open(encoding="utf-8") as strm: + assert TT.get_path_from_stream(strm) == this - self.assertEqual(TT.get_path_from_stream(this, safe=True), '') + with pytest.raises(ValueError): + TT.get_path_from_stream(this) -# vim:sw=4:ts=4:et: + assert TT.get_path_from_stream(this, safe=True) == "" diff --git a/tests/utils/test_lists.py b/tests/utils/test_lists.py index d50e33c2..3ba5641d 100644 --- a/tests/utils/test_lists.py +++ b/tests/utils/test_lists.py @@ -1,36 +1,35 @@ # -# Copyright (C) 2012 - 2021 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # -# pylint: disable=missing-docstring,invalid-name -r"""test cases for anyconfig.utils.lists. -""" +# pylint: disable=missing-docstring +r"""test cases for anyconfig.utils.lists.""" +from __future__ import annotations + import operator -import unittest -import anyconfig.utils.lists as TT +import pytest +import anyconfig.utils.lists as TT -class TestCase(unittest.TestCase): - def test_groupby(self): - items = (("a", 1), ("b", -1), ("c", 1)) - res = TT.groupby(items, operator.itemgetter(1)) - self.assertEqual( - [(key, tuple(grp)) for key, grp in res], - [(-1, (("b", -1),)), (1, (("a", 1), ("c", 1)))] - ) +def test_groupby() -> None: + items = (("a", 1), ("b", -1), ("c", 1)) + res = TT.groupby(items, operator.itemgetter(1)) + assert [ + (key, tuple(grp)) for key, grp in res + ] == [(-1, (("b", -1),)), (1, (("a", 1), ("c", 1)))] - def test_concat(self): - ies = ( - ([[]], []), - ((()), []), - ([[1, 2, 3], [4, 5]], [1, 2, 3, 4, 5]), - ([[1, 2, 3], [4, 5, [6, 7]]], [1, 2, 3, 4, 5, [6, 7]]), - (((1, 2, 3), (4, 5, (6, 7))), [1, 2, 3, 4, 5, (6, 7)]), - (((i, i * 2) for i in range(3)), [0, 0, 1, 2, 2, 4]), - ) - for inp, exp in ies: - self.assertEqual(TT.concat(inp), exp) -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize( + ("xss", "exp"), + (([[]], []), + ((()), []), + ([[1, 2, 3], [4, 5]], [1, 2, 3, 4, 5]), + ([[1, 2, 3], [4, 5, [6, 7]]], [1, 2, 3, 4, 5, [6, 7]]), + (((1, 2, 3), (4, 5, (6, 7))), [1, 2, 3, 4, 5, (6, 7)]), + (((i, i * 2) for i in range(3)), [0, 0, 1, 2, 2, 4]) + ), +) +def test_concat(xss, exp): + assert TT.concat(xss) == exp diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py index 34742de6..a4314403 100644 --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -1,23 +1,21 @@ # -# Copyright (C) 2012 - 2021 Satoru SATOH +# Copyright (C) 2012 - 2024 Satoru SATOH # SPDX-License-Identifier: MIT # # pylint: disable=missing-docstring -r"""test cases for anyconfig.utils.lists. -""" -import unittest - -import anyconfig.utils.utils as TT +r"""test cases for anyconfig.utils.lists.""" +from __future__ import annotations +import pytest -class TestCase(unittest.TestCase): +import anyconfig.utils.utils as TT - def test_filter_options(self): - data = ( - (('aaa', ), dict(aaa=1, bbb=2), dict(aaa=1)), - (('aaa', ), dict(bbb=2), dict()), - ) - for keys, inp, exp in data: - self.assertEqual(TT.filter_options(keys, inp), exp) -# vim:sw=4:ts=4:et: +@pytest.mark.parametrize( + ("keys", "opts", "exp"), + ((('aaa', ), {"aaa": 1, "bbb": 2}, {"aaa": 1}), + (('aaa', ), {"bbb": 2}, {}), + ) +) +def test_filter_options(keys, opts, exp) -> None: + assert TT.filter_options(keys, opts) == exp