91e75e620b
CI: cua-driver distro-compat matrix / Resolve release version (push) Waiting to run
CI: cua-driver distro-compat matrix / debian:12 (glibc 2.36) (push) Blocked by required conditions
CI: cua-driver distro-compat matrix / fedora:41 (glibc 2.40) (push) Blocked by required conditions
CI: cua-driver distro-compat matrix / rockylinux:9 (glibc 2.34) (push) Blocked by required conditions
CI: cua-driver distro-compat matrix / ubuntu:22.04 (glibc 2.35) (push) Blocked by required conditions
CI: cua-driver distro-compat matrix / ubuntu:24.04 (glibc 2.39) (push) Blocked by required conditions
CI: cua-driver distro-compat matrix / Distro compat summary (push) Blocked by required conditions
CI: Nix Linux Rust source / Nix / compositor build (push) Waiting to run
CI: Nix Linux Rust source / Nix / driver package (push) Waiting to run
CI: Nix Linux Rust source / Nix / Rust unit tests (push) Waiting to run
CI: Rust Linux unit / Rust Linux unit and compile (push) Waiting to run
CI: Rust Windows unit / Rust Windows unit and compile (push) Waiting to run
CI: SPDX Headers / Check SPDX headers (warn-only) (push) Waiting to run
CD: Docs MCP Server / build (linux/amd64) (push) Waiting to run
CD: Docs MCP Server / build (linux/arm64) (push) Waiting to run
CD: Docs MCP Server / merge (push) Blocked by required conditions
48 lines
1.2 KiB
Python
48 lines
1.2 KiB
Python
"""Pytest configuration and shared fixtures for computer-server package tests.
|
|
|
|
This file contains shared fixtures and configuration for all computer-server tests.
|
|
Following SRP: This file ONLY handles test setup/teardown.
|
|
"""
|
|
|
|
from unittest.mock import AsyncMock, Mock, patch
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_websocket():
|
|
"""Mock WebSocket connection for testing.
|
|
|
|
Use this fixture to test WebSocket logic without real connections.
|
|
"""
|
|
websocket = AsyncMock()
|
|
websocket.send = AsyncMock()
|
|
websocket.recv = AsyncMock()
|
|
websocket.close = AsyncMock()
|
|
|
|
return websocket
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_computer_interface():
|
|
"""Mock computer interface for server tests.
|
|
|
|
Use this fixture to test server logic without real computer operations.
|
|
"""
|
|
interface = AsyncMock()
|
|
interface.screenshot = AsyncMock(return_value=b"fake_screenshot")
|
|
interface.left_click = AsyncMock()
|
|
interface.type = AsyncMock()
|
|
interface.key = AsyncMock()
|
|
|
|
return interface
|
|
|
|
|
|
@pytest.fixture
|
|
def disable_telemetry(monkeypatch):
|
|
"""Disable telemetry for tests.
|
|
|
|
Use this fixture to ensure no telemetry is sent during tests.
|
|
"""
|
|
monkeypatch.setenv("CUA_TELEMETRY_ENABLED", "false")
|