mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-20 04:35:57 +00:00
Read installer sources once as UTF-8 in the catalog test
This commit is contained in:
1 parent
7ec95eafbe
commit
86a9ea6d53
1 file changed
+4
-3
@@ -520,9 +520,10 @@ class EventsTest(unittest.TestCase):
|
||||
catalog = json.loads((ROOT / 'installer' / 'text' / 'en.json').read_text(encoding='utf-8'))
|
||||
used = set()
|
||||
for path in (ROOT / 'installer').glob('*.py'):
|
||||
used |= set(re.findall(r"InstallError\('([a-z_.]+)'", path.read_text()))
|
||||
used |= set(re.findall(r"warning\('([a-z_.]+)'", path.read_text()))
|
||||
used |= {f'phase.{s}.{p}' for s, p in re.findall(r"progress\('(\w+)', '(\w+)'[,)]", path.read_text())}
|
||||
text = path.read_text(encoding='utf-8')
|
||||
used |= set(re.findall(r"InstallError\('([a-z_.]+)'", text))
|
||||
used |= set(re.findall(r"warning\('([a-z_.]+)'", text))
|
||||
used |= {f'phase.{s}.{p}' for s, p in re.findall(r"progress\('(\w+)', '(\w+)'[,)]", text)}
|
||||
self.assertEqual(sorted(i for i in used if i not in catalog), [])
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user