Callbacks must be called :param refresher:
(refresher)
| 79 | |
| 80 | |
| 81 | def test_refresh_with_callbacks(refresher): |
| 82 | """ |
| 83 | Callbacks must be called |
| 84 | :param refresher: |
| 85 | """ |
| 86 | callbacks = [Mock()] |
| 87 | pgexecute = Mock(**{"is_virtual_database.return_value": False}) |
| 88 | pgexecute.extra_args = {} |
| 89 | special = Mock() |
| 90 | |
| 91 | # Set refreshers to 0: we're not testing refresh logic here |
| 92 | refresher.refreshers = {} |
| 93 | refresher.refresh(pgexecute, special, callbacks) |
| 94 | time.sleep(1) # Wait for the thread to work. |
| 95 | assert callbacks[0].call_count == 1 |