Download scripts/patch_test_assertions.py from deeep-sec/campus-placement-engine: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/deeep-sec/campus-placement-engine/resolve/bbb4aee4c867f6f645e85d3287c52c1decbd3752/scripts/patch_test_assertions.py
- Command line
-
hf download hf://deeep-sec/campus-placement-engine@bbb4aee4c867f6f645e85d3287c52c1decbd3752/scripts/patch_test_assertions.py
-
curl -L -o patch_test_assertions.py https://huggingface.co/deeep-sec/campus-placement-engine/resolve/bbb4aee4c867f6f645e85d3287c52c1decbd3752/scripts/patch_test_assertions.py
1.04 kB
| from pathlib import Path | |
| test_path = Path("backend/tests/test_hidden_edge_cases_regression.py") | |
| text = test_path.read_text(encoding="utf-8") | |
| text = text.replace( | |
| 'assert "one offer and you are out" in res.plain_english_reason.lower()', | |
| 'assert "one-offer" in res.plain_english_reason.lower() or "one offer" in res.plain_english_reason.lower()', | |
| ) | |
| text = text.replace( | |
| 'assert "one offer and you are out" in pol_res.plain_english_reason.lower()', | |
| 'assert "one-offer" in pol_res.plain_english_reason.lower() or "one offer" in pol_res.plain_english_reason.lower()', | |
| ) | |
| text = text.replace( | |
| 'assert "Student ROLL_A is allowed" in comparison.comparative_summary\n assert "ROLL_B is blocked" in comparison.comparative_summary', | |
| 'assert f"({sA.roll_no}) was ALLOWED" in comparison.comparative_summary\n assert f"({sB.roll_no}) was BLOCKED" in comparison.comparative_summary', | |
| ) | |
| test_path.write_text(text, encoding="utf-8") | |
| print("Updated test_hidden_edge_cases_regression.py assertions") | |