File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -103,3 +103,38 @@ def test_copy_empty_file(storage_path, client):
103103 assert op .id is not None
104104 op = api .wait_for (op .id )
105105 assert op [0 ].state == OperationState .Succeeded , op [0 ].messages
106+
107+
108+ def test_multi_copy_parent_progress (storage_path , client ):
109+ """Test progress of parent operation when copying multiple files."""
110+
111+ api = DataTransferApi (client )
112+ api .status (wait = True )
113+
114+ operations = []
115+
116+ for _ in range (3 ):
117+ with tempfile .NamedTemporaryFile (mode = "w" , delete = False ) as temp_file :
118+ temp_file .write ("Mock file" )
119+ temp_file_name = os .path .basename (temp_file .name )
120+
121+ src = StoragePath (path = temp_file .name , remote = "local" )
122+ dst = StoragePath (path = f"{ storage_path } /{ temp_file_name } " )
123+ operations .append (SrcDst (src = src , dst = dst ))
124+
125+ op = api .copy (operations )
126+
127+ assert op .id is not None
128+
129+ # test progress handler
130+ progress_history = []
131+
132+ def handler (ops ):
133+ for o in ops :
134+ if o .id == op .id :
135+ progress_history .append (o .progress )
136+
137+ op = api .wait_for (op .id , interval = 0.05 , handler = handler )
138+ assert op [0 ].state == OperationState .Succeeded , op [0 ].messages
139+
140+ assert None not in progress_history , f"{ progress_history = } "
You can’t perform that action at this time.
0 commit comments