mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
gh-131853: Fix test_msgfmt on big-endian platforms (GH-131879)
Use a generated .mo file instead of a checked in one.
This commit is contained in:
parent
fccf9ab33d
commit
c6b1a07343
1 changed files with 6 additions and 3 deletions
|
@ -42,8 +42,11 @@ class CompilationTest(unittest.TestCase):
|
|||
self.assertDictEqual(actual._catalog, expected._catalog)
|
||||
|
||||
def test_binary_header(self):
|
||||
with open(data_dir / "general.mo", "rb") as f:
|
||||
mo_data = f.read()
|
||||
with temp_cwd():
|
||||
tmp_mo_file = 'messages.mo'
|
||||
compile_messages(data_dir / "general.po", tmp_mo_file)
|
||||
with open(tmp_mo_file, 'rb') as f:
|
||||
mo_data = f.read()
|
||||
|
||||
(
|
||||
magic,
|
||||
|
@ -53,7 +56,7 @@ class CompilationTest(unittest.TestCase):
|
|||
trans_table_offset,
|
||||
hash_table_size,
|
||||
hash_table_offset,
|
||||
) = struct.unpack("=Iiiiiii", mo_data[:28])
|
||||
) = struct.unpack("=7I", mo_data[:28])
|
||||
|
||||
self.assertEqual(magic, 0x950412de)
|
||||
self.assertEqual(version, 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue