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 )