@@ -487,50 +487,6 @@ def test_pssh_copy_file_per_host_args(self):
487
487
os .unlink (remote_file_abspath )
488
488
os .unlink (local_file_path )
489
489
490
- def test_pssh_client_directory_relative_path (self ):
491
- """Tests copying multiple directories with SSH client. Copy all the files from
492
- local directory to server, then make sure they are all present."""
493
- client = ParallelSSHClient ([self .host ], port = self .port ,
494
- pkey = self .user_key )
495
- test_file_data = 'test'
496
- local_test_path = 'directory_test'
497
- remote_test_path = 'directory_test_copied'
498
- dir_name = os .path .dirname (__file__ )
499
- remote_test_path_rel = os .sep .join (
500
- (dir_name .replace (os .path .expanduser ('~' ) + os .sep , '' ),
501
- remote_test_path ))
502
- remote_test_path_abs = os .sep .join ((dir_name , remote_test_path ))
503
- for path in [local_test_path , remote_test_path_abs ]:
504
- try :
505
- shutil .rmtree (path )
506
- except OSError :
507
- pass
508
- os .mkdir (local_test_path )
509
- remote_file_paths = []
510
- for i in range (0 , 10 ):
511
- local_file_path_dir = os .path .join (
512
- local_test_path , 'sub_dir1' , 'sub_dir2' , 'dir_foo' + str (i ))
513
- os .makedirs (local_file_path_dir )
514
- local_file_path = os .path .join (local_file_path_dir , 'foo' + str (i ))
515
- remote_file_path = os .path .join (
516
- remote_test_path , 'sub_dir1' , 'sub_dir2' , 'dir_foo' + str (i ), 'foo' + str (i ))
517
- remote_file_paths .append (
518
- os .sep .join ((os .path .dirname (__file__ ), remote_file_path )))
519
- test_file = open (local_file_path , 'w' )
520
- test_file .write (test_file_data )
521
- test_file .close ()
522
- cmds = client .copy_file (local_test_path , remote_test_path_rel , recurse = True )
523
- try :
524
- joinall (cmds , raise_error = True )
525
- for path in remote_file_paths :
526
- self .assertTrue (os .path .isfile (path ))
527
- finally :
528
- for _path in (local_test_path , remote_test_path_abs ):
529
- try :
530
- shutil .rmtree (_path )
531
- except Exception :
532
- pass
533
-
534
490
def test_pssh_client_directory_abs_path (self ):
535
491
client = ParallelSSHClient ([self .host ], port = self .port ,
536
492
pkey = self .user_key )
0 commit comments