Retire exercise_status: maturity is the only notion; add CLI tests (RBT-WP-0009-T01)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Assistant: claude-code Assistant-Model: sonnet Assistant-Process: 295952@bnt-lap001 Assistant-Session: e93f64ad-516c-46eb-9666-aad8d300c477
This commit is contained in:
parent
b89e8eaa74
commit
6d3414d8b7
29 changed files with 444 additions and 218 deletions
|
|
@ -64,17 +64,6 @@ def test_scorecard_counts_every_outcome_and_stale_open_runs(pk):
|
|||
assert c["feedback"]["good"] == 1
|
||||
|
||||
|
||||
def test_finalizing_success_can_record_exercise_status(pk):
|
||||
r = R.create(pk, "bernd"); play_all(r)
|
||||
with pytest.raises(R.RunError):
|
||||
R.apply_exercise(r) # not finalized yet
|
||||
R.finalize(r, "succeeded")
|
||||
status = R.apply_exercise(r)
|
||||
assert status.startswith("exercised ") and status.endswith(" by bernd")
|
||||
reloaded = P.load(pk.path)
|
||||
assert reloaded.ok and reloaded.data["exercise_status"] == status
|
||||
|
||||
|
||||
def test_capture_documentation_and_limits(pk):
|
||||
r = R.create(pk, "bernd")
|
||||
with pytest.raises(R.RunError, match="start the step"):
|
||||
|
|
@ -166,7 +155,7 @@ def test_closing_records_feedback_with_the_outcome_and_validates_before_changing
|
|||
assert R.load(pk, r.data["run_id"]).data["feedback"][0]["rating"] == "poor"
|
||||
|
||||
|
||||
def test_a_closed_record_cannot_be_saved_with_changes_but_the_exercise_marker_is_allowed(pk):
|
||||
def test_a_closed_record_cannot_be_saved_with_changes(pk):
|
||||
r = R.create(pk, "bernd"); R.finalize(r, "abandoned")
|
||||
r2 = R.load(pk, r.data["run_id"])
|
||||
r2.data["steps"]["read-the-sign"]["state"] = "done"
|
||||
|
|
@ -177,10 +166,7 @@ def test_a_closed_record_cannot_be_saved_with_changes_but_the_exercise_marker_is
|
|||
with pytest.raises(R.RunError, match="operator"):
|
||||
r3.save()
|
||||
assert R.load(pk, r.data["run_id"]).data["operator"] == "bernd" # nothing reached the disk
|
||||
r4 = R.load(pk, r.data["run_id"])
|
||||
r4.data["exercise_recorded"] = "x"
|
||||
r4.save(allow=("exercise_recorded",)) # the one permitted later update
|
||||
assert R.load(pk, r.data["run_id"]).data["exercise_recorded"] == "x" and R.seal_state(R.load(pk, r.data["run_id"])) == "sealed"
|
||||
assert R.seal_state(R.load(pk, r.data["run_id"])) == "sealed" # and the seal still holds
|
||||
|
||||
|
||||
def test_closing_seals_the_file_read_only_and_tampering_is_detected(pk):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue