|
@@ 221-238 (lines=18) @@
|
| 218 |
|
|
| 219 |
|
assert dest_path1 is not None |
| 220 |
|
|
| 221 |
|
def test_import_file_send_to_trash_true(): |
| 222 |
|
raise SkipTest("Temporarily disable send2trash test gh-230") |
| 223 |
|
|
| 224 |
|
temporary_folder, folder = helper.create_working_folder() |
| 225 |
|
temporary_folder_destination, folder_destination = helper.create_working_folder() |
| 226 |
|
|
| 227 |
|
origin = '%s/valid.txt' % folder |
| 228 |
|
shutil.copyfile(helper.get_file('valid.txt'), origin) |
| 229 |
|
|
| 230 |
|
helper.reset_dbs() |
| 231 |
|
dest_path1 = elodie.import_file(origin, folder_destination, False, True, False) |
| 232 |
|
assert not os.path.isfile(origin), origin |
| 233 |
|
helper.restore_dbs() |
| 234 |
|
|
| 235 |
|
shutil.rmtree(folder) |
| 236 |
|
shutil.rmtree(folder_destination) |
| 237 |
|
|
| 238 |
|
assert dest_path1 is not None |
| 239 |
|
|
| 240 |
|
@mock.patch('elodie.config.config_file', '%s/config.ini-import-with-full-path' % gettempdir()) |
| 241 |
|
def test_import_with_full_path(): |
|
@@ 204-219 (lines=16) @@
|
| 201 |
|
assert dest_path2 is not None |
| 202 |
|
assert dest_path1 == dest_path2 |
| 203 |
|
|
| 204 |
|
def test_import_file_send_to_trash_false(): |
| 205 |
|
temporary_folder, folder = helper.create_working_folder() |
| 206 |
|
temporary_folder_destination, folder_destination = helper.create_working_folder() |
| 207 |
|
|
| 208 |
|
origin = '%s/valid.txt' % folder |
| 209 |
|
shutil.copyfile(helper.get_file('valid.txt'), origin) |
| 210 |
|
|
| 211 |
|
helper.reset_dbs() |
| 212 |
|
dest_path1 = elodie.import_file(origin, folder_destination, False, False, False) |
| 213 |
|
assert os.path.isfile(origin), origin |
| 214 |
|
helper.restore_dbs() |
| 215 |
|
|
| 216 |
|
shutil.rmtree(folder) |
| 217 |
|
shutil.rmtree(folder_destination) |
| 218 |
|
|
| 219 |
|
assert dest_path1 is not None |
| 220 |
|
|
| 221 |
|
def test_import_file_send_to_trash_true(): |
| 222 |
|
raise SkipTest("Temporarily disable send2trash test gh-230") |