ЛР 2 - БПИ2301 - Журавлев - на 5 #91

Closed
killoq wants to merge 5 commits from killoq/mtusi2026lab2:solution/bpi2301-zhuravlev into master
2 changed files with 4 additions and 3 deletions
Showing only changes of commit d49914a62f - Show all commits
+1
View File
@@ -0,0 +1 @@
"""Project scripts package."""
+3 -3
View File
@@ -9,8 +9,8 @@ from pathlib import Path
ROOT = Path(__file__).resolve().parents[1] ROOT = Path(__file__).resolve().parents[1]
EVIDENCE = ROOT / 'evidence' / 'track2' EVIDENCE = ROOT / 'evidence' / 'track2'
sys.path.insert(0, str(ROOT / 'scripts')) sys.path.insert(0, str(ROOT))
from track2_backup_restore import snapshot # noqa: E402 from scripts.track2_backup_restore import snapshot
class SnapshotSerializationTests(unittest.TestCase): class SnapshotSerializationTests(unittest.TestCase):
@@ -21,7 +21,7 @@ class SnapshotSerializationTests(unittest.TestCase):
'text': 'первая строка\nвторая строка', 'text': 'первая строка\nвторая строка',
}] }]
with patch( with patch(
'track2_backup_restore.subprocess.check_output', 'scripts.track2_backup_restore.subprocess.check_output',
side_effect=['2\n', '1\n', json.dumps(expected_sample, ensure_ascii=False)], side_effect=['2\n', '1\n', json.dumps(expected_sample, ensure_ascii=False)],
) as check_output: ) as check_output:
result = snapshot('postgres', ['docker', 'compose'], 'messenger') result = snapshot('postgres', ['docker', 'compose'], 'messenger')