diff options
author | Micah Lee <micah@micahflee.com> | 2020-08-21 16:42:20 -0400 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2020-08-21 16:42:20 -0400 |
commit | b1a8c1054bcb194138d40119af46c7a24a4d426f (patch) | |
tree | 7f053d1b1932d90821844c763300105825ac2fd8 /tests | |
parent | 1b9659395ec6e045394f8ab74880e45698906657 (diff) | |
download | onionshare-b1a8c1054bcb194138d40119af46c7a24a4d426f.tar.gz onionshare-b1a8c1054bcb194138d40119af46c7a24a4d426f.zip |
Fix settings tests for Windows
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_cli_settings.py | 10 |
1 files changed, 10 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>. 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", |