MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_compilation

Method test_compilation

Lib/test/test_tools/test_msgfmt.py:27–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

25class CompilationTest(unittest.TestCase):
26
27 def test_compilation(self):
28 self.maxDiff = None
29 with temp_cwd():
30 for po_file in data_dir.glob('*.po'):
31 with self.subTest(po_file=po_file):
32 mo_file = po_file.with_suffix('.mo')
33 with open(mo_file, 'rb') as f:
34 expected = GNUTranslations(f)
35
36 tmp_mo_file = mo_file.name
37 compile_messages(po_file, tmp_mo_file)
38 with open(tmp_mo_file, 'rb') as f:
39 actual = GNUTranslations(f)
40
41 self.assertDictEqual(actual._catalog, expected._catalog)
42
43 def test_translations(self):
44 with open(data_dir / 'general.mo', 'rb') as f:

Callers

nothing calls this directly

Calls 8

temp_cwdFunction · 0.90
GNUTranslationsClass · 0.90
compile_messagesFunction · 0.85
subTestMethod · 0.80
assertDictEqualMethod · 0.80
openFunction · 0.50
globMethod · 0.45
with_suffixMethod · 0.45

Tested by

no test coverage detected