@@ -738,12 +738,13 @@ def test_failure_validate_with_specifying_base_uri_relative_path(self):
738
738
)
739
739
740
740
def test_successful_validate_with_specifying_base_uri_absolute_path (self ):
741
+ absolute_path = os .getcwd ()
741
742
try :
742
743
schema_file = tempfile .NamedTemporaryFile (
743
744
mode = 'w+' ,
744
745
prefix = 'schema' ,
745
746
suffix = '.json' ,
746
- dir = '/' ,
747
+ dir = absolute_path ,
747
748
delete = False
748
749
)
749
750
self .addCleanup (os .remove , schema_file .name )
@@ -758,18 +759,23 @@ def test_successful_validate_with_specifying_base_uri_absolute_path(self):
758
759
759
760
self .assertOutputs (
760
761
files = dict (some_schema = schema , some_instance = '{"KEY1": "1"}' ),
761
- argv = ["-i" , "some_instance" , "--base-uri" , "/" , "some_schema" ],
762
+ argv = [
763
+ "-i" , "some_instance" ,
764
+ "--base-uri" , absolute_path ,
765
+ "some_schema" ,
766
+ ],
762
767
stdout = "" ,
763
768
stderr = "" ,
764
769
)
765
770
766
771
def test_failure_validate_with_specifying_base_uri_absolute_path (self ):
772
+ absolute_path = os .getcwd ()
767
773
try :
768
774
schema_file = tempfile .NamedTemporaryFile (
769
775
mode = 'w+' ,
770
776
prefix = 'schema' ,
771
777
suffix = '.json' ,
772
- dir = '/' ,
778
+ dir = absolute_path ,
773
779
delete = False
774
780
)
775
781
self .addCleanup (os .remove , schema_file .name )
@@ -784,7 +790,11 @@ def test_failure_validate_with_specifying_base_uri_absolute_path(self):
784
790
785
791
self .assertOutputs (
786
792
files = dict (some_schema = schema , some_instance = '{"KEY1": 1}' ),
787
- argv = ["-i" , "some_instance" , "--base-uri" , "/" , "some_schema" ],
793
+ argv = [
794
+ "-i" , "some_instance" ,
795
+ "--base-uri" , absolute_path ,
796
+ "some_schema" ,
797
+ ],
788
798
exit_code = 1 ,
789
799
stdout = "" ,
790
800
stderr = "1: 1 is not of type 'string'\n " ,
@@ -802,7 +812,7 @@ def test_successful_validate_with_specifying_base_uri_remote_path(self):
802
812
argv = [
803
813
"-i" , "some_instance" ,
804
814
"--base-uri" , "https://project-open-data.cio.gov/v1.1/schema/" ,
805
- "some_schema"
815
+ "some_schema" ,
806
816
],
807
817
stdout = "" ,
808
818
stderr = "" ,
@@ -820,7 +830,7 @@ def test_failure_validate_with_specifying_base_uri_remote_path(self):
820
830
argv = [
821
831
"-i" , "some_instance" ,
822
832
"--base-uri" , "https://project-open-data.cio.gov/v1.1/schema/" ,
823
- "some_schema"
833
+ "some_schema" ,
824
834
],
825
835
exit_code = 1 ,
826
836
stdout = "" ,
0 commit comments