| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 01e40a7 commit 0300de9
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -762,14 +762,17 @@ def test_environment(self, rw_dir): | |||
| 762 | 762 | def test_handle_process_output(self): | |
| 763 | 763 | from git.cmd import handle_process_output, safer_popen | |
| 764 | 764 | ||
| 765 | - line_count = 5002 | ||
| 766 | - count = [None, 0, 0] | ||
| 765 | + expected_line_count = 5002 | ||
| 766 | + line_counts = [None, 0, 0] | ||
| 767 | + lines = [None, [], []] | ||
| 767 | 768 | ||
| 768 | - def counter_stdout(line): | ||
| 769 | - count[1] += 1 | ||
| 769 | + def stdout_handler(line): | ||
| 770 | + line_counts[1] += 1 | ||
| 771 | + lines[1].append(line) | ||
| 770 | 772 | ||
| 771 | - def counter_stderr(line): | ||
| 772 | - count[2] += 1 | ||
| 773 | + def stderr_handler(line): | ||
| 774 | + line_counts[2] += 1 | ||
| 775 | + lines[2].append(line) | ||
| 773 | 776 | ||
| 774 | 777 | cmdline = [ | |
| 775 | 778 | sys.executable, | |
@@ -784,10 +787,10 @@ def counter_stderr(line): | |||
| 784 | 787 | shell=False, | |
| 785 | 788 | ) | |
| 786 | 789 | ||
| 787 | - handle_process_output(proc, counter_stdout, counter_stderr, finalize_process) | ||
| 790 | + handle_process_output(proc, stdout_handler, stderr_handler, finalize_process) | ||
| 788 | 791 | ||
| 789 | - self.assertEqual(count[1], line_count) | ||
| 790 | - self.assertEqual(count[2], line_count) | ||
| 792 | + self.assertEqual(line_counts[1], expected_line_count, repr(lines[1])) | ||
| 793 | + self.assertEqual(line_counts[2], expected_line_count, repr(lines[2])) | ||
| 791 | 794 | ||
| 792 | 795 | def test_execute_kwargs_set_agrees_with_method(self): | |
| 793 | 796 | parameter_names = inspect.signature(cmd.Git.execute).parameters.keys() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments