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

Method test_number_all_lines

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

Source from the content-addressed store, hash-verified

75 self.assertIn("missing.txt", result.stderr)
76
77 def test_number_all_lines(self):
78 with tempfile.TemporaryDirectory() as temp_dir:
79 file_path = Path(temp_dir) / "lines.txt"
80 file_path.write_text("Alpha\n\nBeta\n", encoding="utf-8")
81
82 result = self.run_cat("-n", file_path)
83
84 expected = " 1\tAlpha\n 2\t\n 3\tBeta\n"
85 self.assertEqual(result.returncode, 0)
86 self.assertEqual(result.stdout, expected)
87
88 def test_number_nonblank_lines(self):
89 with tempfile.TemporaryDirectory() as temp_dir:

Callers

nothing calls this directly

Calls 1

run_catMethod · 0.95

Tested by

no test coverage detected