def test_add_error_menu(self): root = wx.Menu() controller = MenuController(root) menu_01 = wx.Menu() menu_id = 'menu_01' menu_02 = wx.Menu() controller.addMenu(menu_id, menu_01) self.assertRaises(KeyError, controller.addMenu, menu_id, menu_02)
def test_add_01_menu(self): root = wx.Menu() controller = MenuController(root) menu = wx.Menu() menu_id = 'menu_01' controller.addMenu(menu_id, menu) self.assertIn(menu_id, controller) self.assertEqual(controller[menu_id], menu)
def test_add_02_menu(self): root = wx.Menu() controller = MenuController(root) menu_01 = wx.Menu() menu_id_01 = 'menu_01' controller.addMenu(menu_id_01, menu_01) menu_02 = wx.Menu() menu_id_02 = 'menu_02' controller.addMenu(menu_id_02, menu_02) self.assertIn(menu_id_01, controller) self.assertEqual(controller[menu_id_01], menu_01) self.assertIn(menu_id_02, controller) self.assertEqual(controller[menu_id_02], menu_02)