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

Method test_dash_reads_stdin_between_files

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

Source from the content-addressed store, hash-verified

48 self.assertEqual(result.stdout, "From stdin\nSecond line\n")
49
50 def test_dash_reads_stdin_between_files(self):
51 with tempfile.TemporaryDirectory() as temp_dir:
52 first = Path(temp_dir) / "first.txt"
53 second = Path(temp_dir) / "second.txt"
54 first.write_text("Before\n", encoding="utf-8")
55 second.write_text("After\n", encoding="utf-8")
56
57 result = self.run_cat(first, "-", second, input_text="Middle\n")
58
59 self.assertEqual(result.returncode, 0)
60 self.assertEqual(result.stdout, "Before\nMiddle\nAfter\n")
61
62 def test_missing_file_reports_error_and_continues(self):
63 with tempfile.TemporaryDirectory() as temp_dir:

Callers

nothing calls this directly

Calls 1

run_catMethod · 0.95

Tested by

no test coverage detected