MCPcopy Index your code
hub / github.com/geekcomputers/Python / test_number_nonblank_lines

Method test_number_nonblank_lines

Cat/test_cat.py:88–97  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

86 self.assertEqual(result.stdout, expected)
87
88 def test_number_nonblank_lines(self):
89 with tempfile.TemporaryDirectory() as temp_dir:
90 file_path = Path(temp_dir) / "lines.txt"
91 file_path.write_text("Alpha\n\nBeta\n", encoding="utf-8")
92
93 result = self.run_cat("-b", file_path)
94
95 expected = " 1\tAlpha\n\n 2\tBeta\n"
96 self.assertEqual(result.returncode, 0)
97 self.assertEqual(result.stdout, expected)
98
99 def test_number_nonblank_takes_priority_over_number(self):
100 with tempfile.TemporaryDirectory() as temp_dir:

Callers

nothing calls this directly

Calls 1

run_catMethod · 0.95

Tested by

no test coverage detected