1212
1313from samtranslator .yaml_helper import yaml_parse
1414
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 ())
1618
1719# TODO: Enable (most likely) everything but 'error_*' and 'basic_schema_validation_failure'
1820SKIPPED_TESTS = [
@@ -61,12 +63,12 @@ def should_skip_test(s: str) -> bool:
6163
6264def get_all_test_templates ():
6365 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" ))
7072 )
7173
7274
@@ -81,8 +83,8 @@ def test_validate_schema(self, testcase):
8183
8284 @parameterized .expand (
8385 [
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" ),) ,
8688 ]
8789 )
8890 def test_validate_schema_error (self , testcase ):
0 commit comments