2026-05-14 11:21:10 +02:00
|
|
|
import pytest
|
2026-05-12 21:34:14 -07:00
|
|
|
|
2026-05-14 11:21:10 +02:00
|
|
|
from invisible_playwright.constants import ARCHIVE_NAME, BINARY_BASENAME, BINARY_VERSION
|
2026-05-12 21:34:14 -07:00
|
|
|
|
2026-05-14 11:21:10 +02:00
|
|
|
|
|
|
|
|
@pytest.mark.unit
|
2026-05-12 21:34:14 -07:00
|
|
|
def test_binary_version_format():
|
|
|
|
|
assert BINARY_VERSION.startswith("firefox-")
|
|
|
|
|
assert BINARY_VERSION.split("-", 1)[1].isdigit()
|
|
|
|
|
|
|
|
|
|
|
2026-05-14 11:21:10 +02:00
|
|
|
@pytest.mark.unit
|
2026-05-12 21:34:14 -07:00
|
|
|
def test_archive_name_windows():
|
|
|
|
|
name = ARCHIVE_NAME("win32", "AMD64")
|
|
|
|
|
assert name.endswith(".zip")
|
|
|
|
|
assert "win-x86_64" in name
|
|
|
|
|
|
|
|
|
|
|
2026-05-14 11:21:10 +02:00
|
|
|
@pytest.mark.unit
|
2026-05-12 21:34:14 -07:00
|
|
|
def test_archive_name_linux():
|
|
|
|
|
name = ARCHIVE_NAME("linux", "x86_64")
|
|
|
|
|
assert name.endswith(".tar.gz")
|
|
|
|
|
assert "linux-x86_64" in name
|
|
|
|
|
|
|
|
|
|
|
2026-05-14 11:21:10 +02:00
|
|
|
@pytest.mark.unit
|
2026-05-12 21:34:14 -07:00
|
|
|
def test_archive_name_unsupported_raises():
|
|
|
|
|
with pytest.raises(NotImplementedError):
|
|
|
|
|
ARCHIVE_NAME("darwin", "arm64")
|
|
|
|
|
|
|
|
|
|
|
2026-05-14 11:21:10 +02:00
|
|
|
@pytest.mark.unit
|
2026-05-12 21:34:14 -07:00
|
|
|
def test_binary_basename_format():
|
|
|
|
|
assert "firefox" in BINARY_BASENAME.lower()
|
|
|
|
|
assert "stealth" in BINARY_BASENAME.lower()
|