@@ -227,6 +227,33 @@ def test_train_predictor_fail_and_log_with_remote_access(self):
227227 self .assertTrue (fs .exists (log_file_path ), f"Path: { log_file_path } " )
228228 fs .remove (log_file_path )
229229
230+ def test_samples_dir_inferred_from_remote_home (self ):
231+ """Test samples_dir is correctly inferred using a remote path in HOME"""
232+
233+ # Save initial state
234+ # This runner has remote paths (for root_temp_dir for example)
235+ initial_runner = kh .get_runner ()
236+ initial_home = os .environ .get ("HOME" )
237+
238+ # Set a remote path to HOME
239+ os .environ ["HOME" ] = initial_runner .root_temp_dir
240+ test_runner = KhiopsLocalRunner ()
241+ kh .set_runner (test_runner )
242+
243+ # Test the home path is indeed remote
244+ self .assertFalse (fs .is_local_resource (os .environ ["HOME" ]))
245+
246+ # Test that samples_dir is built according to the expectations
247+ expected_samples_dir = fs .get_child_path (
248+ fs .get_child_path (os .environ ["HOME" ], "khiops_data" ), "samples"
249+ )
250+ self .assertEqual (test_runner .samples_dir , expected_samples_dir )
251+
252+ # Restore initial state
253+ if initial_home is not None :
254+ os .environ ["HOME" ] = initial_home
255+ kh .set_runner (initial_runner )
256+
230257
231258class KhiopsS3RemoteFileTests (KhiopsRemoteAccessTestsContainer .KhiopsRemoteAccessTests ):
232259 """Integration tests with Amazon S3 filesystems"""
0 commit comments