@@ -227,6 +227,34 @@ 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 either samples_dir is correctly inferred
232+ using a remote path in HOME
233+ """
234+
235+ # Save initial state
236+ # This runner has remote paths (for root_temp_dir for example)
237+ initial_runner = kh .get_runner ()
238+ initial_home = os .environ .get ("HOME" )
239+
240+ # Set a remote path to HOME
241+ os .environ ["HOME" ] = initial_runner .root_temp_dir
242+ test_runner = KhiopsLocalRunner ()
243+ kh .set_runner (test_runner )
244+
245+ # Test the home path is indeed remote
246+ self .assertFalse (fs .is_local_resource (os .environ ["HOME" ]))
247+
248+ # Test that samples_dir is built according to the expectations
249+ expected_samples_dir = fs .get_child_path (
250+ fs .get_child_path (os .environ ["HOME" ], "khiops_data" ), "samples"
251+ )
252+ self .assertEqual (test_runner .samples_dir , expected_samples_dir )
253+
254+ # Restore initial state
255+ os .environ ["HOME" ] = initial_home
256+ kh .set_runner (initial_runner )
257+
230258
231259class KhiopsS3RemoteFileTests (KhiopsRemoteAccessTestsContainer .KhiopsRemoteAccessTests ):
232260 """Integration tests with Amazon S3 filesystems"""
0 commit comments