Answer stability round 1: 0 🔴, 5 🟡; test the lock-error and slot-folder exits and the default folder, and return a Failure from held_slot

This commit is contained in:
2026-10-23 11:06:55 +02:00
parent dde9caa172
commit 792fa2b8b0
3 changed files with 30 additions and 4 deletions
+6
View File
@@ -67,6 +67,12 @@ class RunHeavy(unittest.TestCase):
result = self.run_tool("echo", "nested", env={**self.env, main.HELD: "0"})
self.assertEqual((result.returncode, result.stdout), (0, "nested\n"))
def test_exits_125_saying_why_where_the_slot_folder_cannot_be_made(self):
with tempfile.NamedTemporaryFile() as state:
result = self.run_tool("echo", "ran", env={**self.env, "XDG_STATE_HOME": state.name})
self.assertEqual((result.returncode, result.stdout), (125, ""))
self.assertIn(state.name, result.stderr)
def test_a_command_not_found_exits_127_and_one_that_cannot_run_126_saying_why(self):
missing = self.run_tool("no-such-command-anywhere")
self.assertEqual((missing.returncode, missing.stdout), (127, ""))