Skip to content

Commit eb8e673

Browse files
committed
[py] Update tests and add aarch64
1 parent 3983201 commit eb8e673

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

py/selenium/webdriver/common/selenium_manager.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,13 @@ def _get_binary() -> Path:
8484
("cygwin", "arm64"): "windows/selenium-manager-arm64.exe",
8585
("linux", "x86_64"): "linux/selenium-manager",
8686
("linux", "arm64"): "linux/selenium-manager-arm64",
87+
("linux", "aarch64"): "linux/selenium-manager-arm64",
8788
("freebsd", "x86_64"): "linux/selenium-manager",
8889
("freebsd", "arm64"): "linux/selenium-manager-arm64",
90+
("freebsd", "aarch64"): "linux/selenium-manager-arm64",
8991
("openbsd", "x86_64"): "linux/selenium-manager",
9092
("openbsd", "arm64"): "linux/selenium-manager-arm64",
93+
("openbsd", "aarch64"): "linux/selenium-manager-arm64",
9194
}
9295

9396
arch = "any" if sys.platform == "darwin" else platform.machine().lower()

py/test/selenium/webdriver/common/selenium_manager_tests.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,38 @@ def test_uses_environment_variable(monkeypatch):
5353

5454
def test_uses_windows(monkeypatch):
5555
monkeypatch.setattr(sys, "platform", "win32")
56+
monkeypatch.setattr("platform.machine", lambda: "AMD64")
5657
binary = SeleniumManager()._get_binary()
5758

5859
project_root = Path(selenium.__file__).parent.parent
5960
assert binary == project_root.joinpath("selenium/webdriver/common/windows/selenium-manager.exe")
6061

6162

63+
def test_uses_windows_arm(monkeypatch):
64+
monkeypatch.setattr(sys, "platform", "win32")
65+
monkeypatch.setattr("platform.machine", lambda: "arm64")
66+
binary = SeleniumManager()._get_binary()
67+
68+
project_root = Path(selenium.__file__).parent.parent
69+
assert binary == project_root.joinpath("selenium/webdriver/common/windows/selenium-manager-arm64.exe")
70+
71+
6272
def test_uses_linux(monkeypatch):
6373
monkeypatch.setattr(sys, "platform", "linux")
74+
monkeypatch.setattr("platform.machine", lambda: "x86_64")
6475

65-
if platform.machine() == "arm64":
66-
with pytest.raises(WebDriverException, match="Unsupported platform/architecture combination: linux/arm64"):
67-
SeleniumManager()._get_binary()
68-
else:
69-
binary = SeleniumManager()._get_binary()
70-
project_root = Path(selenium.__file__).parent.parent
71-
assert binary == project_root.joinpath("selenium/webdriver/common/linux/selenium-manager")
76+
binary = SeleniumManager()._get_binary()
77+
project_root = Path(selenium.__file__).parent.parent
78+
assert binary == project_root.joinpath("selenium/webdriver/common/linux/selenium-manager")
79+
80+
81+
def test_uses_linux(monkeypatch):
82+
monkeypatch.setattr(sys, "platform", "linux")
83+
monkeypatch.setattr("platform.machine", lambda: "arm64")
84+
85+
binary = SeleniumManager()._get_binary()
86+
project_root = Path(selenium.__file__).parent.parent
87+
assert binary == project_root.joinpath("selenium/webdriver/common/linux/selenium-manager-arm64")
7288

7389

7490
def test_uses_mac(monkeypatch):

0 commit comments

Comments
 (0)