MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_line_iter_basic

Method test_line_iter_basic

ci/tests/test_running_process.py:62–93  ·  view source on GitHub ↗

Validate context-managed line iteration yields only strings and completes.

(self: "TestRunningProcess")

Source from the content-addressed store, hash-verified

60 self.assertIn("hello", combined)
61
62 def test_line_iter_basic(self: "TestRunningProcess") -> None:
63 """Validate context-managed line iteration yields only strings and completes."""
64
65 command: list[str] = [
66 "uv",
67 "run",
68 "python",
69 "-c",
70 "print('a'); print('b'); print('c')",
71 ]
72
73 rp: RunningProcess = RunningProcess(
74 command=command,
75 cwd=Path(".").absolute(),
76 check=False,
77 auto_run=True,
78 timeout=10,
79 on_complete=None,
80 output_formatter=None,
81 )
82
83 iter_lines: list[str] = []
84 with rp.line_iter(timeout=60) as it:
85 for ln in it:
86 # Should always be a string, never None
87 self.assertIsInstance(ln, str)
88 iter_lines.append(ln)
89
90 # Process should have finished; ensure exit success
91 rc: Any = rp.wait()
92 self.assertEqual(rc, 0)
93 self.assertEqual(iter_lines, ["a", "b", "c"])
94
95
96class _UpperFormatter:

Callers

nothing calls this directly

Calls 2

appendMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected