(self)
| 45 | self.assertDictEqual(actual._catalog, expected._catalog) |
| 46 | |
| 47 | def test_binary_header(self): |
| 48 | with temp_cwd(): |
| 49 | tmp_mo_file = 'messages.mo' |
| 50 | compile_messages(data_dir / "general.po", tmp_mo_file) |
| 51 | with open(tmp_mo_file, 'rb') as f: |
| 52 | mo_data = f.read() |
| 53 | |
| 54 | ( |
| 55 | magic, |
| 56 | version, |
| 57 | num_strings, |
| 58 | orig_table_offset, |
| 59 | trans_table_offset, |
| 60 | hash_table_size, |
| 61 | hash_table_offset, |
| 62 | ) = struct.unpack("=7I", mo_data[:28]) |
| 63 | |
| 64 | self.assertEqual(magic, 0x950412de) |
| 65 | self.assertEqual(version, 0) |
| 66 | self.assertEqual(num_strings, 9) |
| 67 | self.assertEqual(orig_table_offset, 28) |
| 68 | self.assertEqual(trans_table_offset, 100) |
| 69 | self.assertEqual(hash_table_size, 0) |
| 70 | self.assertEqual(hash_table_offset, 0) |
| 71 | |
| 72 | def test_translations(self): |
| 73 | with open(data_dir / 'general.mo', 'rb') as f: |
nothing calls this directly
no test coverage detected