mirror of
https://github.com/feder-cr/invisible_playwright.git
synced 2026-06-28 09:29:37 +02:00
test: add pytest markers, conftest, fix Windows-incompatible existing tests
- Add tests/conftest.py with deterministic_rng + sample_profile fixtures - Register unit/integration/e2e markers in pyproject.toml - Mark existing 14 tests as @pytest.mark.unit - Fix test_cli.py: use 'invisible_playwright' (underscore) for 'python -m' - Fix test_translate_includes_gpu_renderer: assert Windows behavior (empty renderer)
This commit is contained in:
parent
c690dbfd33
commit
957f84d9a5
6 changed files with 53 additions and 9 deletions
|
|
@ -1,29 +1,35 @@
|
|||
from invisible_playwright.constants import BINARY_VERSION, BINARY_BASENAME, ARCHIVE_NAME
|
||||
import pytest
|
||||
|
||||
from invisible_playwright.constants import ARCHIVE_NAME, BINARY_BASENAME, BINARY_VERSION
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_binary_version_format():
|
||||
assert BINARY_VERSION.startswith("firefox-")
|
||||
assert BINARY_VERSION.split("-", 1)[1].isdigit()
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_archive_name_windows():
|
||||
name = ARCHIVE_NAME("win32", "AMD64")
|
||||
assert name.endswith(".zip")
|
||||
assert "win-x86_64" in name
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_archive_name_linux():
|
||||
name = ARCHIVE_NAME("linux", "x86_64")
|
||||
assert name.endswith(".tar.gz")
|
||||
assert "linux-x86_64" in name
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_archive_name_unsupported_raises():
|
||||
import pytest
|
||||
with pytest.raises(NotImplementedError):
|
||||
ARCHIVE_NAME("darwin", "arm64")
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_binary_basename_format():
|
||||
assert "firefox" in BINARY_BASENAME.lower()
|
||||
assert "stealth" in BINARY_BASENAME.lower()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue