(self)
| 12 | |
| 13 | class TestEvent: |
| 14 | def testEvent(self): |
| 15 | test_obj = ExampleClass() |
| 16 | test_obj.onChanged.append(lambda: test_obj.increment("Called #1")) |
| 17 | test_obj.onChanged.append(lambda: test_obj.increment("Called #2")) |
| 18 | test_obj.onChanged.once(lambda: test_obj.increment("Once")) |
| 19 | |
| 20 | assert test_obj.called == [] |
| 21 | test_obj.onChanged() |
| 22 | assert test_obj.called == ["Called #1", "Called #2", "Once"] |
| 23 | test_obj.onChanged() |
| 24 | test_obj.onChanged() |
| 25 | assert test_obj.called == ["Called #1", "Called #2", "Once", "Called #1", "Called #2", "Called #1", "Called #2"] |
| 26 | |
| 27 | def testOnce(self): |
| 28 | test_obj = ExampleClass() |
nothing calls this directly
no test coverage detected