mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-27 08:19:41 -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 json
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import sys
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@ -135,18 +136,27 @@ class TestSettings:
|
|||||||
settings_obj.set("socks_port", "NON_INTEGER")
|
settings_obj.set("socks_port", "NON_INTEGER")
|
||||||
assert settings_obj._settings["socks_port"] == 9050
|
assert settings_obj._settings["socks_port"] == 9050
|
||||||
|
|
||||||
|
@pytest.mark.skipif(sys.platform != "Darwin", reason="requires Darwin")
|
||||||
def test_filename_darwin(self, monkeypatch, platform_darwin):
|
def test_filename_darwin(self, monkeypatch, platform_darwin):
|
||||||
obj = settings.Settings(common.Common())
|
obj = settings.Settings(common.Common())
|
||||||
assert obj.filename == os.path.expanduser(
|
assert obj.filename == os.path.expanduser(
|
||||||
"~/Library/Application Support/OnionShare-testdata/onionshare.json"
|
"~/Library/Application Support/OnionShare-testdata/onionshare.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@pytest.mark.skipif(sys.platform != "Linux", reason="requires Linux")
|
||||||
def test_filename_linux(self, monkeypatch, platform_linux):
|
def test_filename_linux(self, monkeypatch, platform_linux):
|
||||||
obj = settings.Settings(common.Common())
|
obj = settings.Settings(common.Common())
|
||||||
assert obj.filename == os.path.expanduser(
|
assert obj.filename == os.path.expanduser(
|
||||||
"~/.config/onionshare-testdata/onionshare.json"
|
"~/.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):
|
def test_set_custom_bridge(self, settings_obj):
|
||||||
settings_obj.set(
|
settings_obj.set(
|
||||||
"tor_bridges_use_custom_bridges",
|
"tor_bridges_use_custom_bridges",
|
||||||
|
Loading…
Reference in New Issue
Block a user