fix: test
This commit is contained in:
parent
4c7657ce75
commit
8ae8b0cdfb
@ -15,7 +15,7 @@ from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from src.core.SeriesApp import OperationResult, OperationStatus, ProgressInfo, SeriesApp
|
||||
from src.core.SeriesApp import SeriesApp
|
||||
|
||||
|
||||
class TestSeriesAppInitialization:
|
||||
@ -451,53 +451,3 @@ class TestSeriesAppGetters:
|
||||
operation = app.get_current_operation()
|
||||
assert operation == "test_op"
|
||||
|
||||
|
||||
class TestProgressInfo:
|
||||
"""Test ProgressInfo dataclass."""
|
||||
|
||||
def test_progress_info_creation(self):
|
||||
"""Test creating ProgressInfo."""
|
||||
info = ProgressInfo(
|
||||
current=5,
|
||||
total=10,
|
||||
message="Processing...",
|
||||
percentage=50.0,
|
||||
status=OperationStatus.RUNNING
|
||||
)
|
||||
|
||||
assert info.current == 5
|
||||
assert info.total == 10
|
||||
assert info.message == "Processing..."
|
||||
assert info.percentage == 50.0
|
||||
assert info.status == OperationStatus.RUNNING
|
||||
|
||||
|
||||
class TestOperationResult:
|
||||
"""Test OperationResult dataclass."""
|
||||
|
||||
def test_operation_result_success(self):
|
||||
"""Test creating successful OperationResult."""
|
||||
result = OperationResult(
|
||||
success=True,
|
||||
message="Operation completed",
|
||||
data={"key": "value"}
|
||||
)
|
||||
|
||||
assert result.success is True
|
||||
assert result.message == "Operation completed"
|
||||
assert result.data == {"key": "value"}
|
||||
assert result.error is None
|
||||
|
||||
def test_operation_result_failure(self):
|
||||
"""Test creating failed OperationResult."""
|
||||
error = RuntimeError("Test error")
|
||||
result = OperationResult(
|
||||
success=False,
|
||||
message="Operation failed",
|
||||
error=error
|
||||
)
|
||||
|
||||
assert result.success is False
|
||||
assert result.message == "Operation failed"
|
||||
assert result.error == error
|
||||
assert result.data is None
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user