test(api): isolate identity lookup from runtime database
This commit is contained in:
1 parent
4c4c38f987
commit
d69c2afe9a
1 file changed
+5
-1
+5
-1
@@ -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())
|
||||
|
||||
|
||||
Reference in new issue
Block a user