Skip to content

Commit

Permalink
use tmp_path in test_move_dropbox_folder_to_existing
Browse files Browse the repository at this point in the history
  • Loading branch information
samschott committed May 18, 2024
1 parent 2999321 commit 1e58da3
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions tests/linked/integration/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
InotifyError,
)
from maestral.constants import FileStatus, IDLE
from maestral.utils.path import delete
from maestral.utils.integration import get_inotify_limits


Expand Down Expand Up @@ -136,21 +135,15 @@ def test_move_dropbox_folder_to_itself(m: Maestral) -> None:
assert m.running


def test_move_dropbox_folder_to_existing(m: Maestral) -> None:
new_dir_short = "~/New Dropbox"
new_dir = osp.realpath(osp.expanduser(new_dir_short))
os.mkdir(new_dir)

try:
with pytest.raises(FileExistsError):
m.move_dropbox_directory(new_dir)
def test_move_dropbox_folder_to_existing(m: Maestral, tmp_path) -> None:
new_dir = tmp_path / "new_dbx_dir"
new_dir.mkdir()

# assert that sync is still running
assert m.running
with pytest.raises(FileExistsError):
m.move_dropbox_directory(str(new_dir))

finally:
# cleanup
delete(new_dir)
# assert that sync is still running
assert m.running


# API integration tests
Expand Down

0 comments on commit 1e58da3

Please sign in to comment.