コード例 #1
0
ファイル: test_document.py プロジェクト: luojiguicai/jina
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)
コード例 #2
0
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)