Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /dislovelhl_enhanced-agent-bus /tests /constitutional_saga /teststepstatus.py
| """ | |
| Comprehensive tests for Constitutional Saga workflow module. | |
| Constitutional Hash: 608508a9bd224290 | |
| Coverage targets: | |
| - SagaStatus and StepStatus enums | |
| - SagaCompensation, SagaStep, SagaContext, SagaResult, SagaState dataclasses | |
| - FileSagaPersistenceProvider | |
| - DefaultSagaActivities | |
| - Saga execution and compensation flow | |
| """ | |
| import asyncio | |
| import json | |
| import tempfile | |
| from datetime import datetime, timezone | |
| from pathlib import Path | |
| from unittest.mock import AsyncMock, MagicMock | |
| import pytest | |
| from enhanced_agent_bus.deliberation_layer.workflows.constitutional_saga import ( | |
| CONSTITUTIONAL_HASH, | |
| DefaultSagaActivities, | |
| FileSagaPersistenceProvider, | |
| SagaCompensation, | |
| SagaContext, | |
| SagaResult, | |
| SagaState, | |
| SagaStatus, | |
| SagaStep, | |
| StepStatus, | |
| ) | |
| class TestStepStatus: | |
| """Tests for StepStatus enum.""" | |
| def test_all_statuses_exist(self): | |
| """Test all step statuses are defined.""" | |
| statuses = list(StepStatus) | |
| assert len(statuses) == 7 | |
| def test_pending_value(self): | |
| assert StepStatus.PENDING.value == "pending" | |
| def test_executing_value(self): | |
| assert StepStatus.EXECUTING.value == "executing" | |
| def test_completed_value(self): | |
| assert StepStatus.COMPLETED.value == "completed" | |
| def test_failed_value(self): | |
| assert StepStatus.FAILED.value == "failed" | |
| def test_compensating_value(self): | |
| assert StepStatus.COMPENSATING.value == "compensating" | |
| def test_compensated_value(self): | |
| assert StepStatus.COMPENSATED.value == "compensated" | |
| def test_compensation_failed_value(self): | |
| assert StepStatus.COMPENSATION_FAILED.value == "compensation_failed" | |
Xet Storage Details
- Size:
- 1.7 kB
- Xet hash:
- 0256a0b294b07aad04d2aa6542d3c95ac7c56a75b1e0d565c83a4f64e6f7e9d0
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.