MCPcopy Index your code
hub / github.com/dbcli/pgcli / test_refresh_called_once

Function test_refresh_called_once

tests/test_completion_refresher.py:33–49  ·  view source on GitHub ↗

:param refresher: :return:

(refresher)

Source from the content-addressed store, hash-verified

31
32
33def test_refresh_called_once(refresher):
34 """
35
36 :param refresher:
37 :return:
38 """
39 callbacks = Mock()
40 pgexecute = Mock(**{"is_virtual_database.return_value": False})
41 special = Mock()
42
43 with patch.object(refresher, "_bg_refresh") as bg_refresh:
44 actual = refresher.refresh(pgexecute, special, callbacks)
45 time.sleep(1) # Wait for the thread to work.
46 assert len(actual) == 1
47 assert len(actual[0]) == 4
48 assert actual[0][3] == "Auto-completion refresh started in the background."
49 bg_refresh.assert_called_with(pgexecute, special, callbacks, None, None)
50
51
52def test_refresh_called_twice(refresher):

Callers

nothing calls this directly

Calls 1

refreshMethod · 0.80

Tested by

no test coverage detected