コード例 #1
0
ファイル: test_flowstore.py プロジェクト: yaneshtyagi/jina
def test_flow_store():
    store = FlowStore()
    flow_id = store.add(config=open(str(cur_dir / 'flow.yml'), 'rb'))
    assert len(store) == 1
    assert flow_id in store
    assert isinstance(store[flow_id]['object'], Flow)
    store.delete(flow_id)
    assert flow_id not in store
    assert not store
コード例 #2
0
async def test_flow_store(workspace):
    store = FlowStore()
    flow_id = DaemonID('jflow')
    flow_model = FlowModel()
    flow_model.uses = f'flow.yml'

    await store.add(
        id=flow_id,
        workspace_id=workspace,
        params=flow_model,
        ports={},
        port_expose=56789,
    )
    assert len(store) == 1
    assert flow_id in store
    await store.delete(flow_id)
    assert flow_id not in store
    assert not store