def test_high_order_matches(mocker): response_mock = mocker.Mock() f = Flow().add(uses=MyExecutor) with f: f.post( on='index', inputs=Document(matches=[Document() for i in range(5)]), on_done=response_mock, ) validate_callback(response_mock, validate)
def test_single_executor(): f = Flow().add( uses={'jtype': 'MatchAdder', 'with': {'traversal_paths': ['r', 'm']}} ) with f: results = f.post( on='index', inputs=Document(), return_results=True, ) validate_results(results)