(input_paths, output_path)
| 233 | |
| 234 | print("Example 10") |
| 235 | def confirm_merge(input_paths, output_path): |
| 236 | found = collections.defaultdict(list) |
| 237 | with open(output_path, "rb") as f: |
| 238 | for line in f: |
| 239 | for path in input_paths: |
| 240 | if line.find(path.encode()) == 0: |
| 241 | found[path].append(line) |
| 242 | |
| 243 | expected = collections.defaultdict(list) |
| 244 | for path in input_paths: |
| 245 | with open(path, "rb") as f: |
| 246 | expected[path].extend(f.readlines()) |
| 247 | |
| 248 | for key, expected_lines in expected.items(): |
| 249 | found_lines = found[key] |
| 250 | assert expected_lines == found_lines |
| 251 | |
| 252 | input_paths = ... |
| 253 | handles = ... |
no test coverage detected