Answer stability round 1: 1 🔴, 4 🟡 (1 misread); refuse an env-file in the main checkout from a worktree, test the DM wiring in-process, and record why an unreadable config skips the DM

This commit is contained in:
2026-11-13 20:38:53 +01:00
parent e758bf1a91
commit 3a3631609c
3 changed files with 36 additions and 8 deletions
+8
View File
@@ -13,6 +13,7 @@ import unittest.mock
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from mattermost_dm.dm import http_json
from loop_effects.effects import run_python, say, system_effects
NOW = 1790000000
@@ -59,6 +60,13 @@ class Said(unittest.TestCase):
class Dm(unittest.TestCase):
def test_sends_the_text_for_the_project_holding_the_current_directory_with_the_real_http(self):
with unittest.mock.patch("loop_effects.effects.dm", return_value=None) as sent:
self.assertIsNone(system_effects().dm("Which one?"))
sent.assert_called_once_with("Which one?", None, pathlib.Path.home(), http_json)
class LocalTime(unittest.TestCase):
def test_renders_seconds_in_the_machines_zone(self):
# A POSIX zone two hours ahead of UTC, so a time in UTC would read 14:13:20. Cleanups run last in, first out: the zone is restored before time.tzset makes the clock read it again.