From 9a8b19c40996452bff738eb77db91c127881bb05 Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Thu, 13 Jun 2024 18:18:52 +0200 Subject: [PATCH] test: improve integration tests --- src/antares_web_installer/app.py | 2 +- tests/integration/test_app.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/antares_web_installer/app.py b/src/antares_web_installer/app.py index 742b268..8a64276 100644 --- a/src/antares_web_installer/app.py +++ b/src/antares_web_installer/app.py @@ -94,7 +94,7 @@ def install_files(self): else: # copy all files from package - copytree(self.source_dir, self.target_dir) + copytree(self.source_dir, self.target_dir, dirs_exist_ok=True) def copy_files(self): """ diff --git a/tests/integration/test_app.py b/tests/integration/test_app.py index 7d74741..1dbcf69 100644 --- a/tests/integration/test_app.py +++ b/tests/integration/test_app.py @@ -69,8 +69,8 @@ def test_run__empty_target( - The server is correctly started """ # Patch the `get_desktop` function according to the current platform - platform = {"nt": "windows", "posix": "linux", "darwin": "darwin"}[os.name] - monkeypatch.setattr(f"pyshortcuts.{platform}.get_desktop", lambda: desktop_dir) + platform = {"nt": "_win32_shell", "posix": "_linux_shell"}[os.name] + monkeypatch.setattr(f"antares_web_installer.shortcuts.{platform}.get_desktop", lambda: desktop_dir) # Run the application app = App(source_dir=downloaded_dir, target_dir=program_dir, shortcut=True, launch=True)