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:
@@ -7,6 +7,7 @@ from sqlmodel import Session, select
|
||||
from fluksio.core.config import settings
|
||||
from fluksio.core.db import seed_flavors
|
||||
from fluksio.models import Flavor
|
||||
from tests.utils.flows import put_flow
|
||||
|
||||
|
||||
def test_an_instance_starts_with_sizes_to_pick_from(
|
||||
@@ -97,12 +98,11 @@ def test_a_flow_cannot_name_a_size_that_does_not_exist(
|
||||
client: TestClient, superuser_token_headers: dict[str, str]
|
||||
) -> None:
|
||||
"""Caught at the save, which covers the canvas and `fluksio sync` at once."""
|
||||
response = client.put(
|
||||
f"{settings.API_V1_STR}/flows/flavor_check",
|
||||
response = client.post(
|
||||
f"{settings.API_V1_STR}/flows/",
|
||||
headers=superuser_token_headers,
|
||||
json={
|
||||
"name": "flavor_check",
|
||||
"version": 1,
|
||||
"nodes": [
|
||||
{"id": "fit", "type": "python", "resources": {"flavor": "imaginary"}}
|
||||
],
|
||||
@@ -120,12 +120,11 @@ def test_a_size_a_node_still_asks_for_is_not_deleted(
|
||||
headers=superuser_token_headers,
|
||||
json={"name": "in-use", "cpus": 2},
|
||||
)
|
||||
client.put(
|
||||
f"{settings.API_V1_STR}/flows/flavor_user",
|
||||
headers=superuser_token_headers,
|
||||
json={
|
||||
put_flow(
|
||||
client,
|
||||
superuser_token_headers,
|
||||
{
|
||||
"name": "flavor_user",
|
||||
"version": 1,
|
||||
"nodes": [
|
||||
{"id": "fit", "type": "python", "resources": {"flavor": "in-use"}}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user