Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /terrene-foundation_kailash-py /tests /regression /test_issue_191.py
| # Copyright 2026 Terrene Foundation | |
| # SPDX-License-Identifier: Apache-2.0 | |
| """Regression: #191 — 'pseudo' posture rejected, only 'pseudo_agent' accepted. | |
| The bug: TrustPosture("pseudo") raised ValueError. All other CARE-spec lowercase | |
| posture names worked. Only L1 was broken because the enum value was "pseudo_agent". | |
| Fix: _missing_ classmethod maps "pseudo" → PSEUDO_AGENT. | |
| Cross-SDK: esperie-enterprise/kailash-rs#118 | |
| """ | |
| import pytest | |
| from kailash.trust.posture.postures import TrustPosture | |
| class TestIssue191PseudoPosture: | |
| """All CARE-spec posture names must parse correctly.""" | |
| def test_pseudo_lowercase(self) -> None: | |
| assert TrustPosture("pseudo") is TrustPosture.PSEUDO_AGENT | |
| def test_pseudo_agent_still_works(self) -> None: | |
| assert TrustPosture("pseudo_agent") is TrustPosture.PSEUDO_AGENT | |
| def test_all_care_spec_names(self) -> None: | |
| """All 5 CARE-spec lowercase posture names must parse.""" | |
| assert TrustPosture("delegated") is TrustPosture.DELEGATED | |
| assert TrustPosture("continuous_insight") is TrustPosture.CONTINUOUS_INSIGHT | |
| assert TrustPosture("shared_planning") is TrustPosture.SHARED_PLANNING | |
| assert TrustPosture("supervised") is TrustPosture.SUPERVISED | |
| assert TrustPosture("pseudo") is TrustPosture.PSEUDO_AGENT | |
| def test_case_insensitive(self) -> None: | |
| assert TrustPosture("PSEUDO") is TrustPosture.PSEUDO_AGENT | |
| assert TrustPosture("Pseudo") is TrustPosture.PSEUDO_AGENT | |
| def test_invalid_still_raises(self) -> None: | |
| with pytest.raises(ValueError): | |
| TrustPosture("nonexistent_posture") | |
Xet Storage Details
- Size:
- 1.66 kB
- Xet hash:
- 3db1e2c167b02a6da1722f7e3467b3a2c8e141bc2dc429dfd3e7ff47908f1d67
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.