summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2021-05-02 15:32:45 -0700
committerMicah Lee <micah@micahflee.com>2021-05-02 15:32:45 -0700
commit3c36c4766c26637a7832285b45a3616d5081ec13 (patch)
tree99b58b063fe52eb726765b7e920da8a2f7418be8
parent94d5544bdaddb2b8d7fcd6491ee2f0c01d25fd04 (diff)
downloadonionshare-3c36c4766c26637a7832285b45a3616d5081ec13.tar.gz
onionshare-3c36c4766c26637a7832285b45a3616d5081ec13.zip
Fix CLI tests in Windows
-rw-r--r--cli/tests/test_cli_common.py6
-rw-r--r--cli/tests/test_cli_web.py4
2 files changed, 8 insertions, 2 deletions
diff --git a/cli/tests/test_cli_common.py b/cli/tests/test_cli_common.py
index ef4732be..3288e52b 100644
--- a/cli/tests/test_cli_common.py
+++ b/cli/tests/test_cli_common.py
@@ -131,7 +131,7 @@ class TestGetAvailablePort:
((random.randint(1024, 1500), random.randint(1800, 2048)) for _ in range(50)),
)
def test_returns_an_open_port(self, common_obj, port_min, port_max):
- """ get_available_port() should return an open port within the range """
+ """get_available_port() should return an open port within the range"""
port = common_obj.get_available_port(port_min, port_max)
assert port_min <= port <= port_max
@@ -191,7 +191,9 @@ class TestGetTorPaths:
@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
def test_get_tor_paths_windows(self, platform_windows, common_obj, sys_frozen):
base_path = os.path.join(
- os.path.dirname(os.path.dirname(common_obj.get_resource_path(""))), "tor"
+ os.path.dirname(os.path.dirname(common_obj.get_resource_path(""))),
+ "resources",
+ "tor",
)
tor_path = os.path.join(os.path.join(base_path, "Tor"), "tor.exe")
obfs4proxy_file_path = os.path.join(
diff --git a/cli/tests/test_cli_web.py b/cli/tests/test_cli_web.py
index 26990be3..9bb640e1 100644
--- a/cli/tests/test_cli_web.py
+++ b/cli/tests/test_cli_web.py
@@ -8,6 +8,7 @@ import zipfile
import tempfile
import base64
import shutil
+import platform
from io import BytesIO
import pytest
@@ -615,6 +616,7 @@ class TestRangeRequests:
h.add("Authorization", "Basic " + auth)
return h
+ @pytest.mark.skipif(platform.system() == "Windows", reason="skip Windows")
@check_unsupported("curl", ["--version"])
def test_curl(self, temp_dir, tmpdir, common_obj):
web = web_obj(temp_dir, common_obj, "share", 3)
@@ -639,6 +641,7 @@ class TestRangeRequests:
]
)
+ @pytest.mark.skipif(platform.system() == "Windows", reason="skip Windows")
@check_unsupported("wget", ["--version"])
def test_wget(self, temp_dir, tmpdir, common_obj):
web = web_obj(temp_dir, common_obj, "share", 3)
@@ -662,6 +665,7 @@ class TestRangeRequests:
]
)
+ @pytest.mark.skipif(platform.system() == "Windows", reason="skip Windows")
@check_unsupported("http", ["--version"])
def test_httpie(self, temp_dir, common_obj):
web = web_obj(temp_dir, common_obj, "share", 3)