From d49914a62f2f0fc2dc70f4f20b0ca1c9b97bac2a Mon Sep 17 00:00:00 2001 From: killoq7 Date: Fri, 23 Oct 2026 18:33:24 +0300 Subject: [PATCH] fixed test import --- scripts/__init__.py | 1 + student-tests/test_track2.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 scripts/__init__.py diff --git a/scripts/__init__.py b/scripts/__init__.py new file mode 100644 index 0000000..69dd550 --- /dev/null +++ b/scripts/__init__.py @@ -0,0 +1 @@ +"""Project scripts package.""" diff --git a/student-tests/test_track2.py b/student-tests/test_track2.py index 280bd05..95a3456 100644 --- a/student-tests/test_track2.py +++ b/student-tests/test_track2.py @@ -9,8 +9,8 @@ from pathlib import Path ROOT = Path(__file__).resolve().parents[1] EVIDENCE = ROOT / 'evidence' / 'track2' -sys.path.insert(0, str(ROOT / 'scripts')) -from track2_backup_restore import snapshot # noqa: E402 +sys.path.insert(0, str(ROOT)) +from scripts.track2_backup_restore import snapshot class SnapshotSerializationTests(unittest.TestCase): @@ -21,7 +21,7 @@ class SnapshotSerializationTests(unittest.TestCase): 'text': 'первая строка\nвторая строка', }] 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)], ) as check_output: result = snapshot('postgres', ['docker', 'compose'], 'messenger')