Get the output that was written by the object being tested.
(self)
| 64 | self.input_queue.append(json.dumps(data).encode() + b"\n") |
| 65 | |
| 66 | def get_output(self) -> List[dict]: |
| 67 | """Get the output that was written by the object being tested.""" |
| 68 | results = [] |
| 69 | for data in self.output_buffer: |
| 70 | if isinstance(data, bytes) and data.endswith(b"\n"): |
| 71 | try: |
| 72 | results.append(json.loads(data.decode().strip())) |
| 73 | except json.JSONDecodeError: |
| 74 | pass # Ignore non-JSON output |
| 75 | self.output_buffer = [] |
| 76 | return results |
| 77 | |
| 78 | |
| 79 | class PdbClientTestCase(unittest.TestCase): |
no test coverage detected