def test_remove_msg(self): expected = MsgCollection() msg_collection = MsgCollection() msg_collection.add_msg(id='Box', str='Ящик') msg_collection.remove_msg(id='Box') result = msg_collection self.assertEqual(expected, result)
def execute(self, line, msg_collection: MsgCollection): msgid_plural = line.split('msgid_plural')[1].strip().strip('"') if msg_collection.current_msg: current_id = msg_collection.current_msg.id current_paths = msg_collection.current_msg.paths msg_collection.remove_msg(current_id) msg_collection.add_msg_plural(id=current_id, id_plural=msgid_plural, strs=[], paths=current_paths) msg_collection.current_msg = msg_collection.get_msg(id=current_id) return raise ValueError()