fix(parser): clarify free-form inspection input

This commit is contained in:
nyan404 committed 2026-08-25 03:54:35 +03:00
1 parent c0a6f6286e
commit 32bb5ae3d0
5 files changed
+78 -19

No files matched your search

+12
View File
@@ -254,6 +254,18 @@ class VkConversationTests(unittest.TestCase):
self.assertEqual(inspected["fields"]["character_id"], 1617140)
self.assertIn("имени", " ".join(inspected["questions"]).lower())
def test_natural_inspection_does_not_confuse_date_or_id_with_count(self):
inspected = inspect_bulk_text(
"24.08 осмотр расщелина: 6 раз; персонаж Серолап id 1 617 140; +2 паутина, +1 паук"
)
self.assertEqual(inspected["fields"]["inspections"], 6)
self.assertEqual((inspected["fields"]["character_name"], inspected["fields"]["character_id"]), ("Серолап", 1617140))
self.assertEqual(inspected["fields"]["resources"], [["паутина", 2], ["паук", 1]])
def test_natural_inspection_accepts_legacy_resource_assignments_without_count_noise(self):
inspected = inspect_bulk_text("осмотр дупло 6 раз Серолап [1617140]; паутина=2, паук: 1")
self.assertEqual(inspected["fields"]["resources"], [["паутина", 2], ["паук", 1]])
def test_identity_directory_persists_pairs_in_sqlite(self):
with TemporaryDirectory() as directory:
path = f"{directory}/identities.sqlite3"