@@ -808,7 +808,7 @@ def test_datalink_querier_load_data_vot_exception(mock_datalink_querier, overwri
808
808
now = datetime .datetime .now (datetime .timezone .utc )
809
809
output_file = 'datalink_output_' + now .strftime ("%Y%m%dT%H%M%S" ) + '.zip'
810
810
811
- file_final = Path (os .getcwd () + '/' + output_file )
811
+ file_final = Path (os .getcwd (), output_file )
812
812
813
813
Path (file_final ).touch ()
814
814
@@ -858,7 +858,7 @@ def test_datalink_querier_load_data_vot(mock_datalink_querier):
858
858
files = os .listdir (direc )
859
859
# Filtering only the files.
860
860
files = [f for f in files if
861
- os . path . isfile (direc + '/' + f ) and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
861
+ Path (direc , f ). is_file ( ) and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
862
862
863
863
assert len (files ) == 1
864
864
datalink_output = files [0 ]
@@ -896,7 +896,7 @@ def test_datalink_querier_load_data_ecsv(mock_datalink_querier_ecsv):
896
896
files = os .listdir (direc )
897
897
# Filtering only the files.
898
898
files = [f for f in files if
899
- os . path . isfile (direc + '/' + f ) and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
899
+ Path (direc , f ). is_file ( ) and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
900
900
901
901
assert len (files ) == 1
902
902
datalink_output = files [0 ]
@@ -934,7 +934,7 @@ def test_datalink_querier_load_data_csv(mock_datalink_querier_csv):
934
934
files = os .listdir (direc )
935
935
# Filtering only the files.
936
936
files = [f for f in files if
937
- os . path . isfile (direc + '/' + f ) and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
937
+ Path (direc , f ). is_file ( ) and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
938
938
939
939
assert len (files ) == 1
940
940
datalink_output = files [0 ]
@@ -973,7 +973,7 @@ def test_datalink_querier_load_data_fits(mock_datalink_querier_fits):
973
973
files = os .listdir (direc )
974
974
# Filtering only the files.
975
975
files = [f for f in files if
976
- os . path . isfile (direc + '/' + f ) and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
976
+ Path (direc , f ). is_file ( ) and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
977
977
978
978
assert len (files ) == 1
979
979
datalink_output = files [0 ]
@@ -1002,7 +1002,7 @@ def test_load_data_vot(monkeypatch, tmp_path, tmp_path_factory):
1002
1002
now = datetime .datetime .now (datetime .timezone .utc )
1003
1003
output_file = 'datalink_output_' + now .strftime ("%Y%m%dT%H%M%S" ) + '.zip'
1004
1004
1005
- path = Path (os .getcwd () + '/' + output_file )
1005
+ path = Path (os .getcwd (), output_file )
1006
1006
1007
1007
with open (DL_PRODUCTS_VOT , 'rb' ) as file :
1008
1008
zip_bytes = file .read ()
@@ -1039,7 +1039,7 @@ def test_load_data_fits(monkeypatch, tmp_path, tmp_path_factory):
1039
1039
now = datetime .datetime .now (datetime .timezone .utc )
1040
1040
output_file = 'datalink_output_' + now .strftime ("%Y%m%dT%H%M%S" ) + '.zip'
1041
1041
1042
- path = Path (os .getcwd () + '/' + output_file )
1042
+ path = Path (os .getcwd (), output_file )
1043
1043
1044
1044
with open (DL_PRODUCTS_FITS , 'rb' ) as file :
1045
1045
zip_bytes = file .read ()
@@ -1054,7 +1054,7 @@ def load_data_monkeypatched(self, params_dict, output_file, verbose):
1054
1054
"RETRIEVAL_TYPE" : "epoch_photometry" ,
1055
1055
"DATA_STRUCTURE" : "INDIVIDUAL" ,
1056
1056
"USE_ZIP_ALWAYS" : "true" }
1057
- assert output_file == os .getcwd () + '/' + ' datalink_output.zip'
1057
+ assert output_file == Path ( os .getcwd (), ' datalink_output.zip')
1058
1058
assert verbose is True
1059
1059
1060
1060
monkeypatch .setattr (TapPlus , "load_data" , load_data_monkeypatched )
@@ -1075,7 +1075,7 @@ def test_load_data_csv(monkeypatch, tmp_path, tmp_path_factory):
1075
1075
now = datetime .datetime .now (datetime .timezone .utc )
1076
1076
output_file = 'datalink_output_' + now .strftime ("%Y%m%dT%H%M%S" ) + '.zip'
1077
1077
1078
- path = Path (os .getcwd () + '/' + output_file )
1078
+ path = Path (os .getcwd (), output_file )
1079
1079
1080
1080
with open (DL_PRODUCTS_CSV , 'rb' ) as file :
1081
1081
zip_bytes = file .read ()
@@ -1111,7 +1111,7 @@ def test_load_data_ecsv(monkeypatch, tmp_path, tmp_path_factory):
1111
1111
now = datetime .datetime .now (datetime .timezone .utc )
1112
1112
output_file = 'datalink_output_' + now .strftime ("%Y%m%dT%H%M%S" ) + '.zip'
1113
1113
1114
- path = Path (os .getcwd () + '/' + output_file )
1114
+ path = Path (os .getcwd (), output_file )
1115
1115
1116
1116
with open (DL_PRODUCTS_ECSV , 'rb' ) as file :
1117
1117
zip_bytes = file .read ()
@@ -1147,7 +1147,7 @@ def test_load_data_linking_parameter(monkeypatch, tmp_path):
1147
1147
now = datetime .datetime .now (datetime .timezone .utc )
1148
1148
output_file = 'datalink_output_' + now .strftime ("%Y%m%dT%H%M%S" ) + '.zip'
1149
1149
1150
- path = Path (os .getcwd () + '/' + output_file )
1150
+ path = Path (os .getcwd (), output_file )
1151
1151
1152
1152
with open (DL_PRODUCTS_VOT , 'rb' ) as file :
1153
1153
zip_bytes = file .read ()
@@ -1184,7 +1184,7 @@ def test_load_data_linking_parameter_with_values(monkeypatch, tmp_path, linking_
1184
1184
now = datetime .datetime .now (datetime .timezone .utc )
1185
1185
output_file = 'datalink_output_' + now .strftime ("%Y%m%dT%H%M%S" ) + '.zip'
1186
1186
1187
- path = Path (os .getcwd () + '/' + output_file )
1187
+ path = Path (os .getcwd (), output_file )
1188
1188
1189
1189
with open (DL_PRODUCTS_VOT , 'rb' ) as file :
1190
1190
zip_bytes = file .read ()
@@ -1196,7 +1196,7 @@ def load_data_monkeypatched(self, params_dict, output_file, verbose):
1196
1196
files = os .listdir (direc )
1197
1197
# Filtering only the files.
1198
1198
files = [f for f in files if
1199
- os . path . isfile (direc + '/' + f ) and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
1199
+ Path (direc , f ). is_file ( ) and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
1200
1200
1201
1201
assert len (files ) == 1
1202
1202
datalink_output = files [0 ]
@@ -1209,7 +1209,7 @@ def load_data_monkeypatched(self, params_dict, output_file, verbose):
1209
1209
"DATA_STRUCTURE" : "INDIVIDUAL" ,
1210
1210
"LINKING_PARAMETER" : linking_param ,
1211
1211
"USE_ZIP_ALWAYS" : "true" , }
1212
- assert output_file == os .getcwd () + '/' + datalink_output
1212
+ assert output_file == str ( Path ( os .getcwd (), datalink_output ))
1213
1213
assert verbose is True
1214
1214
1215
1215
monkeypatch .setattr (TapPlus , "load_data" , load_data_monkeypatched )
0 commit comments