MCPcopy
hub / github.com/dbcli/pgcli / test_refresh_with_callbacks

Function test_refresh_with_callbacks

tests/test_completion_refresher.py:81–95  ·  view source on GitHub ↗

Callbacks must be called :param refresher:

(refresher)

Source from the content-addressed store, hash-verified

79
80
81def 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

Callers

nothing calls this directly

Calls 1

refreshMethod · 0.80

Tested by

no test coverage detected