MCPcopy Index your code
hub / github.com/python/cpython / test_compilation

Method test_compilation

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected