Реализовать лабораторную работу 3

This commit is contained in:
Никита
2026-11-02 18:55:53 +03:00
parent 0ab3a341aa
commit d2ff198781
109 changed files with 25218 additions and 27 deletions
+20
View File
@@ -0,0 +1,20 @@
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / "tests"))
def compose(*args, timeout=90):
result = subprocess.run([str(ROOT / "scripts/compose.sh"), *args], cwd=ROOT,
text=True, capture_output=True, check=True, timeout=timeout)
return result.stdout.strip()
def sql(query):
return compose("exec", "-T", "postgres", "psql", "-X", "-U", "messenger", "-d", "messenger", "-Atc", query)
def redis(*args):
return compose("exec", "-T", "redis", "redis-cli", "--raw", *args)