Merge pull request #491 from AceAtDev/CI/CDtests

Add test infrastructure with CI/CD #478
This commit is contained in:
James Murdza
2025-10-28 17:00:05 -07:00
committed by GitHub
16 changed files with 1184 additions and 10 deletions

View File

@@ -0,0 +1,26 @@
"""Pytest configuration for pylume tests.
This module provides test fixtures for the pylume package.
Note: This package has macOS-specific dependencies and will skip tests
if the required modules are not available.
"""
from unittest.mock import Mock, patch
import pytest
@pytest.fixture
def mock_subprocess():
with patch('subprocess.run') as mock_run:
mock_run.return_value = Mock(
returncode=0,
stdout='',
stderr=''
)
yield mock_run
@pytest.fixture
def mock_requests():
with patch('requests.get') as mock_get, \
patch('requests.post') as mock_post:
yield {'get': mock_get, 'post': mock_post}

View File

@@ -0,0 +1,36 @@
"""Unit tests for pylume package.
This file tests ONLY basic pylume functionality.
Following SRP: This file tests pylume module imports and basic operations.
All external dependencies are mocked.
"""
import pytest
class TestPylumeImports:
"""Test pylume module imports (SRP: Only tests imports)."""
def test_pylume_module_exists(self):
"""Test that pylume module can be imported."""
try:
import pylume
assert pylume is not None
except ImportError:
pytest.skip("pylume module not installed")
class TestPylumeInitialization:
"""Test pylume initialization (SRP: Only tests initialization)."""
def test_pylume_can_be_imported(self):
"""Basic smoke test: verify pylume components can be imported."""
try:
import pylume
# Check for basic attributes
assert pylume is not None
except ImportError:
pytest.skip("pylume module not available")
except Exception as e:
# Some initialization errors are acceptable in unit tests
pytest.skip(f"pylume initialization requires specific setup: {e}")