mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-07 20:17:45 +00:00
732361bb90
- Path injection (B614): centralized safe_resolve_path in core/utils.py, refactored 6 UI modules to use it with safe_root validation - B701: added explicit autoescape=select_autoescape() to Jinja2 Environment() calls in 3 files - B101: replaced assert statements with proper if/raise patterns in 12+ files (partial) - B112: added logger.warning() to bare except:continue blocks in 5 files
23 lines
682 B
Python
23 lines
682 B
Python
from pathlib import Path
|
|
|
|
# Check if our submission file exists
|
|
if not Path("submission.csv").exists():
|
|
raise FileNotFoundError("Error: submission.csv not found")
|
|
|
|
submission_lines = Path("submission.csv").read_text().splitlines()
|
|
test_lines = Path("submission_test.csv").read_text().splitlines()
|
|
|
|
is_valid = len(submission_lines) == len(test_lines)
|
|
|
|
if is_valid:
|
|
message = "submission.csv and submission_test.csv have the same number of lines."
|
|
else:
|
|
message = (
|
|
f"submission.csv has {len(submission_lines)} lines, while submission_test.csv has {len(test_lines)} lines."
|
|
)
|
|
|
|
print(message)
|
|
|
|
if not is_valid:
|
|
raise AssertionError("Submission is invalid")
|