@@ -690,7 +690,7 @@ def test_successful_validate_with_specifying_base_uri_relative_path(self):
690
690
mode = 'w+' ,
691
691
prefix = 'schema' ,
692
692
suffix = '.json' ,
693
- dir = '.. ' ,
693
+ dir = '.' ,
694
694
delete = False
695
695
)
696
696
self .addCleanup (os .remove , schema_file .name )
@@ -705,7 +705,7 @@ def test_successful_validate_with_specifying_base_uri_relative_path(self):
705
705
706
706
self .assertOutputs (
707
707
files = dict (some_schema = schema , some_instance = '{"KEY1": "1"}' ),
708
- argv = ["-i" , "some_instance" , "--base-uri" , ".. " , "some_schema" ],
708
+ argv = ["-i" , "some_instance" , "--base-uri" , "." , "some_schema" ],
709
709
stdout = "" ,
710
710
stderr = "" ,
711
711
)
@@ -716,7 +716,7 @@ def test_failure_validate_with_specifying_base_uri_relative_path(self):
716
716
mode = 'w+' ,
717
717
prefix = 'schema' ,
718
718
suffix = '.json' ,
719
- dir = '.. ' ,
719
+ dir = '.' ,
720
720
delete = False
721
721
)
722
722
self .addCleanup (os .remove , schema_file .name )
@@ -731,7 +731,7 @@ def test_failure_validate_with_specifying_base_uri_relative_path(self):
731
731
732
732
self .assertOutputs (
733
733
files = dict (some_schema = schema , some_instance = '{"KEY1": 1}' ),
734
- argv = ["-i" , "some_instance" , "--base-uri" , ".. " , "some_schema" ],
734
+ argv = ["-i" , "some_instance" , "--base-uri" , "." , "some_schema" ],
735
735
exit_code = 1 ,
736
736
stdout = "" ,
737
737
stderr = "1: 1 is not of type 'string'\n " ,
@@ -757,6 +757,8 @@ def test_successful_validate_with_specifying_base_uri_absolute_path(self):
757
757
finally :
758
758
schema_file .close ()
759
759
760
+ file_prefix = "file:///{}/" if "nt" == os .name else "file://{}/"
761
+ absolute_path = file_prefix .format (absolute_path )
760
762
self .assertOutputs (
761
763
files = dict (some_schema = schema , some_instance = '{"KEY1": "1"}' ),
762
764
argv = [
@@ -788,6 +790,8 @@ def test_failure_validate_with_specifying_base_uri_absolute_path(self):
788
790
finally :
789
791
schema_file .close ()
790
792
793
+ file_prefix = "file:///{}/" if "nt" == os .name else "file://{}/"
794
+ absolute_path = file_prefix .format (absolute_path )
791
795
self .assertOutputs (
792
796
files = dict (some_schema = schema , some_instance = '{"KEY1": 1}' ),
793
797
argv = [
@@ -800,43 +804,6 @@ def test_failure_validate_with_specifying_base_uri_absolute_path(self):
800
804
stderr = "1: 1 is not of type 'string'\n " ,
801
805
)
802
806
803
- def test_successful_validate_with_specifying_base_uri_remote_path (self ):
804
- schema = """
805
- {"type": "object", "properties": {
806
- "KEY1":{"$ref": "organization.json"}}}
807
- """
808
- self .assertOutputs (
809
- files = dict (some_schema = schema ,
810
- some_instance = '{"KEY1": {"name": "remote"}}'
811
- ),
812
- argv = [
813
- "-i" , "some_instance" ,
814
- "--base-uri" , "https://project-open-data.cio.gov/v1.1/schema/" ,
815
- "some_schema" ,
816
- ],
817
- stdout = "" ,
818
- stderr = "" ,
819
- )
820
-
821
- def test_failure_validate_with_specifying_base_uri_remote_path (self ):
822
- schema = """
823
- {"type": "object", "properties": {
824
- "KEY1":{"$ref": "organization.json"}}}
825
- """
826
- self .assertOutputs (
827
- files = dict (some_schema = schema ,
828
- some_instance = '{"KEY1": {"fail": "remote"}}'
829
- ),
830
- argv = [
831
- "-i" , "some_instance" ,
832
- "--base-uri" , "https://project-open-data.cio.gov/v1.1/schema/" ,
833
- "some_schema" ,
834
- ],
835
- exit_code = 1 ,
836
- stdout = "" ,
837
- stderr = "{'fail': 'remote'}: 'name' is a required property\n " ,
838
- )
839
-
840
807
def test_it_validates_using_the_latest_validator_when_unspecified (self ):
841
808
# There isn't a better way now I can think of to ensure that the
842
809
# latest version was used, given that the call to validator_for
0 commit comments