#NEWLINE# def test_refresh_called_once( refresher ) : #NEWLINE# #INDENT# '\n\n    :param refresher:\n    :return:\n    ' #NEWLINE# callbacks = Mock ( ) #NEWLINE# pgexecute = Mock ( ) #NEWLINE# special = Mock ( ) #NEWLINE# with patch . object ( refresher , '_bg_refresh' ) as bg_refresh : #NEWLINE# #INDENT# actual = refresher . refresh ( pgexecute , special , callbacks ) #NEWLINE# time . sleep ( 1 ) #NEWLINE# assert ( len ( actual ) == 1 ) #NEWLINE# assert ( len ( actual [ 0 ] ) == 4 ) #NEWLINE# assert ( actual [ 0 ] [ 3 ] == 'Auto-completion refresh started in the background.' ) #NEWLINE# bg_refresh . assert_called_with ( pgexecute , special , callbacks , None )