MCPcopy Create free account
hub / github.com/dbcli/mycli / test_refresh_with_callbacks

Function test_refresh_with_callbacks

test/pytests/test_completion_refresher.py:125–140  ·  view source on GitHub ↗

Callbacks must be called. :param refresher:

(refresher)

Source from the content-addressed store, hash-verified

123
124
125def test_refresh_with_callbacks(refresher):
126 """Callbacks must be called.
127
128 :param refresher:
129
130 """
131 callbacks = [Mock()]
132 sqlexecute_class = Mock()
133 sqlexecute = Mock()
134
135 with patch("mycli.completion_refresher.SQLExecute", sqlexecute_class):
136 # Set refreshers to 0: we're not testing refresh logic here
137 refresher.refreshers = {}
138 refresher.refresh(sqlexecute, callbacks)
139 time.sleep(1) # Wait for the thread to work.
140 assert callbacks[0].call_count == 1
141
142
143def test_refresh_starts_background_thread(monkeypatch, refresher) -> None:

Callers

nothing calls this directly

Calls 1

refreshMethod · 0.80

Tested by

no test coverage detected