@@ -696,8 +696,7 @@ def test_successful_validate_with_specifying_base_uri_absolute_path(self):
696
696
)
697
697
self .addCleanup (os .remove , schema_file .name )
698
698
schema = """
699
- {"type": "object", "properties": {"KEY1":
700
- {"$ref": "%s#definitions/num"}}}
699
+ {"$ref": "%s#definitions/num"}
701
700
""" % (os .path .basename (schema_file .name ))
702
701
tmp_schema = """{"definitions": {"num": {"type": "integer"}}}"""
703
702
schema_file .write (tmp_schema )
@@ -709,7 +708,7 @@ def test_successful_validate_with_specifying_base_uri_absolute_path(self):
709
708
os .path .dirname (schema_file .name )
710
709
)
711
710
self .assertOutputs (
712
- files = dict (some_schema = schema , some_instance = '{"KEY1": 1} ' ),
711
+ files = dict (some_schema = schema , some_instance = '1 ' ),
713
712
argv = [
714
713
"-i" , "some_instance" ,
715
714
"--base-uri" , absolute_dir_path ,
@@ -727,8 +726,7 @@ def test_failure_validate_with_specifying_base_uri_absolute_path(self):
727
726
)
728
727
self .addCleanup (os .remove , schema_file .name )
729
728
schema = """
730
- {"type": "object", "properties": {"KEY1":
731
- {"$ref": "%s#definitions/num"}}}
729
+ {"$ref": "%s#definitions/num"}
732
730
""" % (os .path .basename (schema_file .name ))
733
731
tmp_schema = """{"definitions": {"num": {"type": "integer"}}}"""
734
732
schema_file .write (tmp_schema )
@@ -740,7 +738,7 @@ def test_failure_validate_with_specifying_base_uri_absolute_path(self):
740
738
os .path .dirname (schema_file .name )
741
739
)
742
740
self .assertOutputs (
743
- files = dict (some_schema = schema , some_instance = '{"KEY1": "1"} ' ),
741
+ files = dict (some_schema = schema , some_instance = '"1" ' ),
744
742
argv = [
745
743
"-i" , "some_instance" ,
746
744
"--base-uri" , absolute_dir_path ,
@@ -753,10 +751,9 @@ def test_failure_validate_with_specifying_base_uri_absolute_path(self):
753
751
754
752
def test_validate_with_specifying_invalid_base_uri (self ):
755
753
schema = """
756
- {"type": "object", "properties": {"KEY1":
757
- {"$ref": "foo.json#definitions/num"}}}
754
+ {"$ref": "foo.json#definitions/num"}
758
755
"""
759
- instance = '{"KEY1": 1} '
756
+ instance = '1 '
760
757
761
758
with self .assertRaises (RefResolutionError ) as e :
762
759
self .assertOutputs (
0 commit comments