Flows and dashboards are created by POST under an issued or superuser-pinned id; PUT only updates; deleted flows leave a tombstone with their key; the controller stores by id and runs by key, hooks live under /hooks/<flow id>; a key with state or queued work behind it is refused until cleared
This commit is contained in:
@@ -15,6 +15,7 @@ from fluksio.flow.pipeline import Pipeline
|
||||
from fluksio.flow.schemas import FlowDef, NodeDef
|
||||
from fluksio.flow.state import MemoryState
|
||||
from fluksio.flow.store import FlowStore
|
||||
from tests.utils.stores import created
|
||||
|
||||
SOURCE = "def process(reading, factor):\n return {'scaled': reading * factor}\n"
|
||||
|
||||
@@ -53,7 +54,7 @@ def test_a_setting_reaches_the_function_as_a_keyword_argument(store: FlowStore):
|
||||
|
||||
|
||||
def test_a_setting_named_after_a_port_is_refused(store: FlowStore):
|
||||
store.write_draft(a_flow(reading=3), 0)
|
||||
created(store, a_flow(reading=3))
|
||||
store.write_node_source("house", "scale", SOURCE, draft=True)
|
||||
controller = FlowController(store)
|
||||
|
||||
@@ -81,7 +82,7 @@ READING = [MessageSpec(name="reading", dtype=DType.FLOAT)]
|
||||
|
||||
|
||||
def _preview(store: FlowStore, flow: FlowDef, source: str | None):
|
||||
store.write_draft(flow, 0)
|
||||
created(store, flow)
|
||||
if source is not None:
|
||||
store.write_node_source("house", "scale", source, draft=True)
|
||||
return FlowController(store).preview("house").nodes[0]
|
||||
|
||||
Reference in New Issue
Block a user