diff --git a/tests/test_cli_settings.py b/tests/test_cli_settings.py index 7a1e8de5..089c7416 100644 --- a/tests/test_cli_settings.py +++ b/tests/test_cli_settings.py @@ -20,6 +20,7 @@ along with this program. If not, see . import json import os import tempfile +import sys import pytest @@ -135,18 +136,27 @@ class TestSettings: settings_obj.set("socks_port", "NON_INTEGER") assert settings_obj._settings["socks_port"] == 9050 + @pytest.mark.skipif(sys.platform != "Darwin", reason="requires Darwin") def test_filename_darwin(self, monkeypatch, platform_darwin): obj = settings.Settings(common.Common()) assert obj.filename == os.path.expanduser( "~/Library/Application Support/OnionShare-testdata/onionshare.json" ) + @pytest.mark.skipif(sys.platform != "Linux", reason="requires Linux") def test_filename_linux(self, monkeypatch, platform_linux): obj = settings.Settings(common.Common()) assert obj.filename == os.path.expanduser( "~/.config/onionshare-testdata/onionshare.json" ) + @pytest.mark.skipif(sys.platform != "win32", reason="requires Windows") + def test_filename_windows(self, monkeypatch, platform_windows): + obj = settings.Settings(common.Common()) + assert obj.filename == os.path.expanduser( + "~\\AppData\\Roaming\\OnionShare-testdata\\onionshare.json" + ) + def test_set_custom_bridge(self, settings_obj): settings_obj.set( "tor_bridges_use_custom_bridges",