Skip to content

Commit 57200e8

Browse files
mmbuguakenyaachon
authored andcommitted
Fix issues for windows test for the test_copy_big_dir
1 parent f890ef4 commit 57200e8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/services/contents/test_manager.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import platform
23
import shutil
34
import sys
45
import time
@@ -87,7 +88,17 @@ def _make_big_dir(contents_manager, api_path):
8788
"""
8889
)
8990

90-
for i in range(200):
91+
# since shutil.copy in Windows can't copy the metadata for files
92+
# the file size of the copied file ends up being smaller than the original
93+
# we only want to increase the number of folder if the tests is being run on
94+
# windows, otherwise the for loop doesn't need to run as long as this
95+
# function is already slow enough
96+
if platform.system() == "Windows":
97+
num_sub_folders = 500
98+
else:
99+
num_sub_folders = 200
100+
101+
for i in range(num_sub_folders):
91102
os.makedirs(f"{os_path}/subfolder-{i}")
92103
for j in range(200):
93104
shutil.copy(

0 commit comments

Comments
 (0)