From d8d30db4eb4c72941b7dcdf5701a2c21d2d6d7de Mon Sep 17 00:00:00 2001 From: dennisvang <29799340+dennisvang@users.noreply.github.com> Date: Tue, 11 Jun 2024 09:51:46 +0200 Subject: [PATCH] verify that symlinks arg is properly passed --- tests/test_utils_platform_specific.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_utils_platform_specific.py b/tests/test_utils_platform_specific.py index 8adf033..a343a6d 100644 --- a/tests/test_utils_platform_specific.py +++ b/tests/test_utils_platform_specific.py @@ -7,9 +7,12 @@ import textwrap from time import sleep import unittest +from unittest.mock import patch from tests import BASE_DIR, TempDirTestCase +import tufup.utils.platform_specific as ps from tufup.utils.platform_specific import ( + ON_MAC, ON_WINDOWS, PLATFORM_SUPPORTED, run_bat_as_admin, @@ -91,6 +94,14 @@ def test_run_bat_as_admin(self): self.assertTrue(len(output)) self.assertNotIn(current_user, output) + @unittest.skipIf(condition=not ON_MAC, reason='macOS only') + def test_install_update_macos_symlinks(self): + with patch.object(ps, '_install_update_mac') as mock_install_update_mac: + ps.install_update(src_dir='', dst_dir='') + mock_install_update_mac.assert_called_with(symlinks=False) + ps.install_update(src_dir='', dst_dir='', symlinks=True) + mock_install_update_mac.assert_called_with(symlinks=True) + @unittest.skipIf( condition=not PLATFORM_SUPPORTED, reason=_reason_platform_not_supported )