File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -35,5 +35,3 @@ mypy==0.971
3535boto3-stubs[appconfig,serverlessrepo]>=1.19.5,==1.*
3636types-PyYAML~=5.4
3737types-jsonschema~=3.2
38-
39- cfn-flip~=1.3.0
Original file line number Diff line number Diff line change 66from pathlib import Path
77from typing import Iterator
88from unittest import TestCase
9- from cfn_flip import to_json # type: ignore
109from jsonschema import validate
1110from jsonschema .exceptions import ValidationError
1211from parameterized import parameterized
1312
13+ from samtranslator .yaml_helper import yaml_parse
1414
1515SCHEMA = json .loads (Path ("samtranslator/schema/schema.json" ).read_bytes ())
1616
@@ -76,7 +76,7 @@ def get_all_test_templates():
7676class TestValidateSchema (TestCase ):
7777 @parameterized .expand (itertools .product (SCHEMA_VALIDATION_TESTS ))
7878 def test_validate_schema (self , testcase ):
79- obj = json . loads ( to_json ( Path (testcase ).read_bytes () ))
79+ obj = yaml_parse ( Path (testcase ).read_bytes ())
8080 validate (obj , schema = SCHEMA )
8181
8282 @parameterized .expand (
@@ -86,6 +86,6 @@ def test_validate_schema(self, testcase):
8686 ]
8787 )
8888 def test_validate_schema_error (self , testcase ):
89- obj = json . loads ( to_json ( Path (testcase ).read_bytes () ))
89+ obj = yaml_parse ( Path (testcase ).read_bytes ())
9090 with pytest .raises (ValidationError ):
9191 validate (obj , schema = SCHEMA )
You can’t perform that action at this time.
0 commit comments