mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-25 22:15:57 -05:00
Fix CLI tests in Windows
This commit is contained in:
parent
94d5544bda
commit
3c36c4766c
@ -131,7 +131,7 @@ class TestGetAvailablePort:
|
|||||||
((random.randint(1024, 1500), random.randint(1800, 2048)) for _ in range(50)),
|
((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):
|
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)
|
port = common_obj.get_available_port(port_min, port_max)
|
||||||
assert port_min <= port <= port_max
|
assert port_min <= port <= port_max
|
||||||
@ -191,7 +191,9 @@ class TestGetTorPaths:
|
|||||||
@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
|
@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
|
||||||
def test_get_tor_paths_windows(self, platform_windows, common_obj, sys_frozen):
|
def test_get_tor_paths_windows(self, platform_windows, common_obj, sys_frozen):
|
||||||
base_path = os.path.join(
|
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")
|
tor_path = os.path.join(os.path.join(base_path, "Tor"), "tor.exe")
|
||||||
obfs4proxy_file_path = os.path.join(
|
obfs4proxy_file_path = os.path.join(
|
||||||
|
@ -8,6 +8,7 @@ import zipfile
|
|||||||
import tempfile
|
import tempfile
|
||||||
import base64
|
import base64
|
||||||
import shutil
|
import shutil
|
||||||
|
import platform
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@ -615,6 +616,7 @@ class TestRangeRequests:
|
|||||||
h.add("Authorization", "Basic " + auth)
|
h.add("Authorization", "Basic " + auth)
|
||||||
return h
|
return h
|
||||||
|
|
||||||
|
@pytest.mark.skipif(platform.system() == "Windows", reason="skip Windows")
|
||||||
@check_unsupported("curl", ["--version"])
|
@check_unsupported("curl", ["--version"])
|
||||||
def test_curl(self, temp_dir, tmpdir, common_obj):
|
def test_curl(self, temp_dir, tmpdir, common_obj):
|
||||||
web = web_obj(temp_dir, common_obj, "share", 3)
|
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"])
|
@check_unsupported("wget", ["--version"])
|
||||||
def test_wget(self, temp_dir, tmpdir, common_obj):
|
def test_wget(self, temp_dir, tmpdir, common_obj):
|
||||||
web = web_obj(temp_dir, common_obj, "share", 3)
|
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"])
|
@check_unsupported("http", ["--version"])
|
||||||
def test_httpie(self, temp_dir, common_obj):
|
def test_httpie(self, temp_dir, common_obj):
|
||||||
web = web_obj(temp_dir, common_obj, "share", 3)
|
web = web_obj(temp_dir, common_obj, "share", 3)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user