Commits

Ali Afshar  committed d0976f5

A way of counting how many times a CheckCalled has been called

  • Participants
  • Parent commits b9b1dc8

Comments (0)

Files changed (2)

File pygtkhelpers/test.py

     """
     def __init__(self, object, signal):
         self.called = None
+        self.called_count = 0
         object.connect(signal, self)
 
     def __call__(self, *k):
+        print 'call'
         self.called = k
+        self.called_count += 1
 

File tests/test_objectlist.py

     items._emit_for_path((0,), e)
     refresh_gui()
     assert item_clicked.called
+    assert item_clicked.called_count == 1
 
 def test_right_click_event(items, user):
     items.append(user, select=True)
     items._emit_for_path((0,), e)
     refresh_gui()
     assert item_clicked.called
+    assert item_clicked.called_count == 1
 
 def test_middle_click_event(items, user):
     items.append(user, select=True)
     items._emit_for_path((0,), e)
     refresh_gui()
     assert item_clicked.called
+    assert item_clicked.called_count == 1
 
 def test_double_click_event(items, user):
     items.append(user, select=True)
     items._emit_for_path((0,), e)
     refresh_gui()
     assert item_clicked.called
+    assert item_clicked.called_count == 1
 
 @py.test.mark.tree_only
 def test_expander_column(items):