Ali Afshar avatar Ali Afshar committed d0976f5

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

Comments (0)

Files changed (2)

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
 

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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.