def test_find_corresponding_message_not_exists(self): catalog = Catalog() catalog.add("id", string="Text") corresponding = find_corresponding_message(catalog, Message("other id")) self.assertIsNone(corresponding) self.assertIsNone( find_corresponding_string(catalog, Message("other id")))
def test_find_corresponding_message_exists(self): catalog = Catalog() catalog.add("id", string="Text") corresponding = find_corresponding_message(catalog, Message("id")) self.assertTrue(corresponding) assert_messages_deeply_equal(corresponding, catalog.get("id")) self.assertEqual(find_corresponding_string(catalog, Message("id")), "Text")