MCPcopy
hub / github.com/alibaba/EasyCV / test_copytree

Method test_copytree

tests/test_file/test_file_io.py:115–130  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

113 io.remove(oss_file_path3)
114
115 def test_copytree(self):
116 # test copy dir from oss to local
117 oss_file_path1 = IO_DATA_TXTX_OSS
118 temp_dir = tempfile.TemporaryDirectory().name
119 io.copytree(oss_file_path1, temp_dir)
120 self.assertTrue(io.exists(temp_dir))
121 self.assertCountEqual(io.listdir(temp_dir), ['a.txt', 'b.txt'])
122
123 # test copy dir from local to oss
124 oss_file_path2 = os.path.join(TMP_DIR_OSS, '%s' % uuid.uuid4().hex)
125 io.copytree(temp_dir, oss_file_path2)
126 self.assertTrue(io.exists(oss_file_path2))
127 self.assertCountEqual(io.listdir(oss_file_path2), ['a.txt', 'b.txt'])
128
129 io.remove(temp_dir)
130 io.remove(oss_file_path2)
131
132 def test_copytree_multi_dirs(self):
133 target = [

Callers

nothing calls this directly

Calls 4

copytreeMethod · 0.45
existsMethod · 0.45
listdirMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected