diff --git a/tests/test_api.py b/tests/test_api.py index bf26fb9..05d8419 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,9 +1,12 @@ import unittest import sqlite3 from tempfile import TemporaryDirectory +from unittest.mock import patch +from app.belki import api from app.belki.api import ApiError, calculate_payload, inspect_bulk_payload, resolve_identity_payload from app.belki.history import CalculationStore +from app.belki.identity import IdentityDirectory class ApiTests(unittest.TestCase): @@ -49,7 +52,8 @@ class ApiTests(unittest.TestCase): self.assertTrue(response["questions"]) def test_identity_resolution_without_directory_requests_missing_half(self): - response = resolve_identity_payload({"character_id": 1617140}) + with patch.object(api, "_IDENTITY_DIRECTORY", IdentityDirectory()): + response = resolve_identity_payload({"character_id": 1617140}) self.assertEqual(response["status"], "needs_input") self.assertIn("имя", response["message"].lower())