Answer the architecture pass's second round

This commit is contained in:
2026-10-02 12:19:14 +02:00
parent e1707183fd
commit f49bd7018b
2 changed files with 25 additions and 15 deletions
+5 -4
View File
@@ -77,7 +77,7 @@ class Render(unittest.TestCase):
self.assertEqual(render({"rate_limits": {"seven_day": {"resets_at": 1e20, "used_percentage": 1}}}), f"{DIM}7d{RESET} {GREEN}1%{RESET}")
def test_counts_a_past_reset_as_zero_left(self):
self.assertEqual(statusline.reset_suffix(NOW - 60, NOW, UTC), f" {DIM}0m left (11:59){RESET}")
self.assertEqual(statusline.reset_suffix(datetime.datetime.fromtimestamp(NOW - 60, UTC), NOW, UTC), f" {DIM}0m left (11:59){RESET}")
class Script(unittest.TestCase):
@@ -88,9 +88,10 @@ class Script(unittest.TestCase):
ran = self.run_script(json.dumps({"cwd": "/nonexistent/a", "model": {"display_name": "Opus"}}))
self.assertEqual((ran.returncode, ran.stdout, ran.stderr), (0, SEP.join([f"{CYAN}~/a{RESET}", f"{DIM}Opus{RESET}"]), ""))
def test_warns_on_the_status_line_for_input_that_is_not_json(self):
ran = self.run_script("not json")
self.assertEqual((ran.returncode, ran.stdout, ran.stderr), (0, f"{RED}warning: statusline.py could not parse its input as JSON{RESET}", ""))
def test_warns_on_the_status_line_for_input_that_is_not_a_json_object(self):
for stdin in ("not json", "[]"):
ran = self.run_script(stdin)
self.assertEqual((ran.returncode, ran.stdout, ran.stderr), (0, f"{RED}warning: statusline.py could not parse its input as a JSON object{RESET}", ""))
def test_shows_the_branch_of_the_directory(self):
with tempfile.TemporaryDirectory() as checkout: