File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 5
5
6
6
7
7
def get_sync_type (src_protocol , dst_protocol ):
8
- if src_protocol == "s3" and dst_protocol != "s3" :
9
- return "download"
10
- elif src_protocol != "s3" and dst_protocol == "s3" :
8
+ if dst_protocol == "s3" or dst_protocol .startswith ("s3+" ):
11
9
return "upload"
10
+ elif src_protocol == "s3" or src_protocol .startswith ("s3+" ):
11
+ return "download"
12
12
else :
13
13
return "copy"
14
14
Original file line number Diff line number Diff line change @@ -610,6 +610,7 @@ def create_generator(_s3_pathname) -> Iterator[FileEntry]:
610
610
yield FileEntry (S3Path (path ).name , path , _make_stat (content ))
611
611
dirname = os .path .dirname (path )
612
612
while dirname not in dirnames and dirname != top_dir :
613
+ # TODO: optimize memory usage and file path order
613
614
dirnames .add (dirname )
614
615
path = dirname + "/" if search_dir else dirname
615
616
if pattern .match (path ):
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ def test_get_sync_type():
6
6
assert compare .get_sync_type ("s3" , "fs" ) == "download"
7
7
assert compare .get_sync_type ("fs" , "s3" ) == "upload"
8
8
assert compare .get_sync_type ("sftp" , "fs" ) == "copy"
9
+ assert compare .get_sync_type ("s3" , "s3" ) == "upload"
10
+ assert compare .get_sync_type ("s3" , "s3+test" ) == "upload"
11
+ assert compare .get_sync_type ("s3+test" , "s3" ) == "upload"
12
+ assert compare .get_sync_type ("s3+test" , "fs" ) == "download"
9
13
10
14
11
15
def test_compare_time ():
You can’t perform that action at this time.
0 commit comments