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
74 lines
2.3 KiB
Python
74 lines
2.3 KiB
Python
"""Unit tests for som package (Set-of-Mark).
|
|
|
|
This file tests ONLY basic som functionality.
|
|
Following SRP: This file tests som module imports and basic operations.
|
|
All external dependencies (ML models, OCR) are mocked.
|
|
"""
|
|
|
|
import pytest
|
|
|
|
|
|
class TestSomImports:
|
|
"""Test som module imports (SRP: Only tests imports)."""
|
|
|
|
def test_som_module_exists(self):
|
|
"""Test that som module can be imported."""
|
|
try:
|
|
import som
|
|
|
|
assert som is not None
|
|
except ImportError:
|
|
pytest.skip("som module not installed")
|
|
|
|
def test_omniparser_import(self):
|
|
"""Test that OmniParser can be imported."""
|
|
try:
|
|
from som import OmniParser
|
|
|
|
assert OmniParser is not None
|
|
except ImportError:
|
|
pytest.skip("som module not available")
|
|
except Exception as e:
|
|
pytest.skip(f"som initialization requires ML models: {e}")
|
|
|
|
def test_models_import(self):
|
|
"""Test that model classes can be imported."""
|
|
try:
|
|
from som import BoundingBox, ParseResult, UIElement
|
|
|
|
assert BoundingBox is not None
|
|
assert UIElement is not None
|
|
assert ParseResult is not None
|
|
except ImportError:
|
|
pytest.skip("som models not available")
|
|
except Exception as e:
|
|
pytest.skip(f"som models require dependencies: {e}")
|
|
|
|
|
|
class TestSomModels:
|
|
"""Test som data models (SRP: Only tests model structure)."""
|
|
|
|
def test_bounding_box_structure(self):
|
|
"""Test BoundingBox class structure."""
|
|
try:
|
|
from som import BoundingBox
|
|
|
|
# Check the class exists and has expected structure
|
|
assert hasattr(BoundingBox, "__init__")
|
|
except ImportError:
|
|
pytest.skip("som models not available")
|
|
except Exception as e:
|
|
pytest.skip(f"som models require dependencies: {e}")
|
|
|
|
def test_ui_element_structure(self):
|
|
"""Test UIElement class structure."""
|
|
try:
|
|
from som import UIElement
|
|
|
|
# Check the class exists and has expected structure
|
|
assert hasattr(UIElement, "__init__")
|
|
except ImportError:
|
|
pytest.skip("som models not available")
|
|
except Exception as e:
|
|
pytest.skip(f"som models require dependencies: {e}")
|