예제 #1
0
 def test_adding_data(self):
     parent = Parent()
     items = PopupMenuItems(parent, ['Do Something'])
     assert_equals(len(items._items), 1)
     items.add_menu_item(PopupMenuItem('Do', parent=parent))
     assert_equals(len(items._items), 2)
     _test = lambda: None
     items.add_menu_item(PopupMenuItem('Do', callable=_test))
     assert_equals(len(items._items), 3)
     assert_equals(items._items[-1].callable, _test)
예제 #2
0
 def test_adding_data(self):
     parent = Parent()
     items = PopupMenuItems(parent, ['Do Something'])
     assert_equal(len(items._items), 1)
     items.add_menu_item(PopupMenuItem('Do', parent=parent))
     assert_equal(len(items._items), 2)
     _test = lambda: None
     items.add_menu_item(PopupMenuItem('Do', callable=_test))
     assert_equal(len(items._items), 3)
     assert_equal(items._items[-1].callable, _test)
예제 #3
0
 def test_adding_separator(self):
     items = PopupMenuItems()
     items.add_separator()
     assert_equals(len(items._items), 1)
예제 #4
0
 def test_adding_separator(self):
     items = PopupMenuItems()
     items.add_separator()
     assert_equal(len(items._items), 1)
예제 #5
0
 def test_initing_with_data(self):
     parent = Parent()
     items = PopupMenuItems(parent, ['Do Something', 'Do'])
     assert_equal(len(items._items), 2)
예제 #6
0
 def test_initing_without_data(self):
     items = PopupMenuItems()
     assert_equal(len(items._items), 0)