Перенесла файлы проекта из предыдущей лабораторной работы

This commit is contained in:
vasyukova
2026-11-04 22:30:42 +03:00
parent 20afc2c790
commit e9a7a7e793
70 changed files with 8588 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env python3
"""Единая команда запуска собственных тестов.
Запускает: test_negative.py, test_concurrency.py.
Публичный smoke запускается отдельно."""
import subprocess
import sys
from pathlib import Path
HERE = Path(__file__).resolve().parent
def run_one(script, base_url):
print("=== %s ===" % script.name)
proc = subprocess.run(
[sys.executable, str(script), "--base-url", base_url],
cwd=str(HERE),
)
if proc.returncode != 0:
print("FAIL: %s" % script.name)
return False
return True
def main():
import argparse
p = argparse.ArgumentParser(description="Lab1 student tests (level 4)")
p.add_argument("--base-url", default="http://localhost:8080")
args = p.parse_args()
ok = True
for script in ("lab1_test_negative.py", "lab1_test_concurrency.py"):
if not run_one(HERE / script, args.base_url):
ok = False
if not ok:
raise SystemExit(1)
print("PASS: all student tests (level 4) passed")
if __name__ == "__main__":
main()