| 6 | |
| 7 | |
| 8 | def check_src_files_have_test(): |
| 9 | missing_test_files = [] |
| 10 | |
| 11 | excluded = [ |
| 12 | "mitmproxy/contrib/", |
| 13 | "mitmproxy/io/proto/", |
| 14 | "mitmproxy/proxy/layers/http", |
| 15 | "mitmproxy/test/", |
| 16 | "mitmproxy/tools/", |
| 17 | "mitmproxy/platform/", |
| 18 | "mitmproxy/utils/pyinstaller/", |
| 19 | ] |
| 20 | src_files = glob.glob("mitmproxy/**/*.py", recursive=True) |
| 21 | src_files = [f for f in src_files if os.path.basename(f) != "__init__.py"] |
| 22 | src_files = [ |
| 23 | f for f in src_files if not any(os.path.normpath(p) in f for p in excluded) |
| 24 | ] |
| 25 | for f in src_files: |
| 26 | p = os.path.join("test", os.path.dirname(f), "test_" + os.path.basename(f)) |
| 27 | if not os.path.isfile(p): |
| 28 | missing_test_files.append((f, p)) |
| 29 | |
| 30 | return missing_test_files |
| 31 | |
| 32 | |
| 33 | def check_test_files_have_src(): |