DazedTL/tests/test_speaker_nameplate.py
DazedAnon 38c4f5350d fix(speakers): clarify parse progress and shorten nameplates
- Mark harvested files as Scanned until vocab write finishes
- Prompt and normalize speakers into short title-case nameplates
- Keep speaker finalize chunking on the Settings batch size
2026-07-25 13:46:57 -05:00

29 lines
948 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for RPG Maker speaker nameplate normalization."""
import unittest
from modules.rpgmakermvmz import _normalize_speaker_nameplate
class SpeakerNameplateNormalizeTests(unittest.TestCase):
def test_title_case_short_name(self):
self.assertEqual(_normalize_speaker_nameplate("clerk"), "Clerk")
def test_strips_speaker_prefix(self):
self.assertEqual(_normalize_speaker_nameplate("Speaker: Townsman"), "Townsman")
def test_collapses_descriptive_sentence(self):
raw = "Just your average electrician guy, the kind you'd find anywhere."
self.assertEqual(_normalize_speaker_nameplate(raw), "Electrician Guy")
def test_truncates_long_phrase(self):
self.assertEqual(
_normalize_speaker_nameplate("ELECTRICIAN GUY FROM NEXT DOOR SHOP"),
"Electrician Guy From",
)
if __name__ == "__main__":
unittest.main()