@@ -690,7 +690,7 @@ def test_successful_validate_with_specifying_base_uri_relative_path(self):
690690 mode = 'w+' ,
691691 prefix = 'schema' ,
692692 suffix = '.json' ,
693- dir = '.. ' ,
693+ dir = '.' ,
694694 delete = False
695695 )
696696 self .addCleanup (os .remove , schema_file .name )
@@ -705,7 +705,7 @@ def test_successful_validate_with_specifying_base_uri_relative_path(self):
705705
706706 self .assertOutputs (
707707 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" ],
709709 stdout = "" ,
710710 stderr = "" ,
711711 )
@@ -716,7 +716,7 @@ def test_failure_validate_with_specifying_base_uri_relative_path(self):
716716 mode = 'w+' ,
717717 prefix = 'schema' ,
718718 suffix = '.json' ,
719- dir = '.. ' ,
719+ dir = '.' ,
720720 delete = False
721721 )
722722 self .addCleanup (os .remove , schema_file .name )
@@ -731,7 +731,7 @@ def test_failure_validate_with_specifying_base_uri_relative_path(self):
731731
732732 self .assertOutputs (
733733 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" ],
735735 exit_code = 1 ,
736736 stdout = "" ,
737737 stderr = "1: 1 is not of type 'string'\n " ,
@@ -757,6 +757,8 @@ def test_successful_validate_with_specifying_base_uri_absolute_path(self):
757757 finally :
758758 schema_file .close ()
759759
760+ file_prefix = "file:///{}/" if "nt" == os .name else "file://{}/"
761+ absolute_path = file_prefix .format (absolute_path )
760762 self .assertOutputs (
761763 files = dict (some_schema = schema , some_instance = '{"KEY1": "1"}' ),
762764 argv = [
@@ -788,6 +790,8 @@ def test_failure_validate_with_specifying_base_uri_absolute_path(self):
788790 finally :
789791 schema_file .close ()
790792
793+ file_prefix = "file:///{}/" if "nt" == os .name else "file://{}/"
794+ absolute_path = file_prefix .format (absolute_path )
791795 self .assertOutputs (
792796 files = dict (some_schema = schema , some_instance = '{"KEY1": 1}' ),
793797 argv = [
@@ -800,43 +804,6 @@ def test_failure_validate_with_specifying_base_uri_absolute_path(self):
800804 stderr = "1: 1 is not of type 'string'\n " ,
801805 )
802806
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-
840807 def test_it_validates_using_the_latest_validator_when_unspecified (self ):
841808 # There isn't a better way now I can think of to ensure that the
842809 # latest version was used, given that the call to validator_for
0 commit comments