From 3c36c4766c26637a7832285b45a3616d5081ec13 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 2 May 2021 15:32:45 -0700 Subject: Fix CLI tests in Windows --- cli/tests/test_cli_common.py | 6 ++++-- cli/tests/test_cli_web.py | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'cli') 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) -- cgit v1.2.3-54-g00ecf