def actual_test(isolation_args): with self._helper_isolate_local_matches(**isolation_args ) as (transmit_result_mock): localcomplete.complete_local_matches() transmit_result_mock.assert_called_once_with(result_list)
def actual_test(isolation_args): with self._helper_isolate_local_matches( **isolation_args) as (transmit_result_mock): localcomplete.complete_local_matches() transmit_result_mock.assert_called_once_with(result_list)
def test_transmits_found_matches_to_vim(self): result_list = ['results'] haystack = ['contents'] min_len = 3 vim_mock = VimMockFactory.get_mock(min_len_local=min_len) find_mock = mock.Mock(spec_set=[], return_value=result_list) haystack_mock = mock.Mock(spec_set=[], return_value=haystack) transmit_result_mock = mock.Mock(spec_set=[], return_value=[]) with mock.patch.multiple( __name__ + '.localcomplete', find_matches_in_lines=find_mock, generate_haystack=haystack_mock, transmit_local_matches_result_to_vim=transmit_result_mock, vim=vim_mock): localcomplete.complete_local_matches() find_mock.assert_called_once_with(haystack, min_len) transmit_result_mock.assert_called_once_with(result_list)
def _helper_completion_tests(self, result_list, **isolation_args): with self._helper_isolate_sut(**isolation_args) as produce_mock: localcomplete.complete_local_matches() produce_mock.assert_called_once_with(result_list, mock.ANY)