12
12
13
13
from samtranslator .yaml_helper import yaml_parse
14
14
15
- SCHEMA = json .loads (Path ("samtranslator/schema/schema.json" ).read_bytes ())
15
+ PROJECT_ROOT = Path (__file__ ).parent .parent .parent
16
+
17
+ SCHEMA = json .loads (PROJECT_ROOT .joinpath ("samtranslator/schema/schema.json" ).read_bytes ())
16
18
17
19
# TODO: Enable (most likely) everything but 'error_*' and 'basic_schema_validation_failure'
18
20
SKIPPED_TESTS = [
@@ -61,12 +63,12 @@ def should_skip_test(s: str) -> bool:
61
63
62
64
def get_all_test_templates ():
63
65
return (
64
- list (Path ("tests/translator/input" ).glob ("**/*.yaml" ))
65
- + list (Path ("tests/translator/input" ).glob ("**/*.yml" ))
66
- + list (Path ("tests/validator/input" ).glob ("**/*.yaml" ))
67
- + list (Path ("tests/validator/input" ).glob ("**/*.yml" ))
68
- + list (Path ("integration/resources/templates" ).glob ("**/*.yaml" ))
69
- + list (Path ("integration/resources/templates" ).glob ("**/*.yml" ))
66
+ list (Path (PROJECT_ROOT , "tests/translator/input" ).glob ("**/*.yaml" ))
67
+ + list (Path (PROJECT_ROOT , "tests/translator/input" ).glob ("**/*.yml" ))
68
+ + list (Path (PROJECT_ROOT , "tests/validator/input" ).glob ("**/*.yaml" ))
69
+ + list (Path (PROJECT_ROOT , "tests/validator/input" ).glob ("**/*.yml" ))
70
+ + list (Path (PROJECT_ROOT , "integration/resources/templates" ).glob ("**/*.yaml" ))
71
+ + list (Path (PROJECT_ROOT , "integration/resources/templates" ).glob ("**/*.yml" ))
70
72
)
71
73
72
74
@@ -81,8 +83,8 @@ def test_validate_schema(self, testcase):
81
83
82
84
@parameterized .expand (
83
85
[
84
- "tests/translator/input/error_schema_validation_wrong_property.yaml" ,
85
- "tests/translator/input/error_schema_validation_wrong_type.yaml" ,
86
+ ( PROJECT_ROOT . joinpath ( "tests/translator/input/error_schema_validation_wrong_property.yaml" ),) ,
87
+ ( PROJECT_ROOT . joinpath ( "tests/translator/input/error_schema_validation_wrong_type.yaml" ),) ,
86
88
]
87
89
)
88
90
def test_validate_schema_error (self , testcase ):
0 commit comments