mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-05-07 17:29:50 +00:00
Change to use a real temporary directory for test
app_test was not using a real temporary location originally
This commit is contained in:
parent
e382683f66
commit
58863b1728
@ -7,6 +7,7 @@
|
|||||||
import os
|
import os
|
||||||
import os.path as op
|
import os.path as op
|
||||||
import logging
|
import logging
|
||||||
|
import tempfile
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -68,10 +69,11 @@ class TestCaseDupeGuru:
|
|||||||
dgapp = TestApp().app
|
dgapp = TestApp().app
|
||||||
dgapp.directories.add_path(p)
|
dgapp.directories.add_path(p)
|
||||||
[f] = dgapp.directories.get_files()
|
[f] = dgapp.directories.get_files()
|
||||||
dgapp.copy_or_move(f, True, "some_destination", 0)
|
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||||
|
dgapp.copy_or_move(f, True, tmp_dir, 0)
|
||||||
eq_(1, len(hscommon.conflict.smart_copy.calls))
|
eq_(1, len(hscommon.conflict.smart_copy.calls))
|
||||||
call = hscommon.conflict.smart_copy.calls[0]
|
call = hscommon.conflict.smart_copy.calls[0]
|
||||||
eq_(call["dest_path"], Path("some_destination", "foo"))
|
eq_(call["dest_path"], Path(tmp_dir, "foo"))
|
||||||
eq_(call["source_path"], f.path)
|
eq_(call["source_path"], f.path)
|
||||||
|
|
||||||
def test_copy_or_move_clean_empty_dirs(self, tmpdir, monkeypatch):
|
def test_copy_or_move_clean_empty_dirs(self, tmpdir, monkeypatch):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user