| 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 = [ |