mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-26 07:49:48 -05:00
Fix settings tests for Windows
This commit is contained in:
parent
1b9659395e
commit
b1a8c1054b
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user