fix: make Langflow-synced flows visible (lfx volume perms, pull dedup)
This commit is contained in:
parent
1326cece42
commit
95a1c1afb7
12 changed files with 5460 additions and 3859 deletions
|
|
@ -176,6 +176,31 @@ async def test_sync_endpoint_pulls_from_langflow_then_syncs(
|
|||
assert body["skipped"] == ["gehaltserh-hung"]
|
||||
|
||||
|
||||
async def test_sync_endpoint_pull_reuses_same_named_file(
|
||||
client, lfx_server, tmp_path, monkeypatch, login, override_langflow
|
||||
):
|
||||
"""A pulled flow seeded from simple_rule.json updates it in place
|
||||
instead of duplicating it as simple-rule.json (slug drift)."""
|
||||
await login()
|
||||
monkeypatch.setattr(settings, "flows_dir", str(tmp_path))
|
||||
_seed_dir(tmp_path) # fixture shape, name "simple_rule"
|
||||
langflow_id = "44444444-5555-4666-8777-888888888888"
|
||||
override_langflow(
|
||||
flows=[{"id": langflow_id, "name": "simple_rule"}],
|
||||
docs={langflow_id: _langflow_doc("simple_rule", langflow_id)},
|
||||
)
|
||||
response = await client.post("/api/flows/sync")
|
||||
assert response.status_code == 200, response.text
|
||||
body = response.json()
|
||||
assert body["pulled"] == ["simple_rule"]
|
||||
assert body["added"] == ["simple_rule"]
|
||||
assert body["errors"] == {}
|
||||
assert not (tmp_path / "simple-rule.json").exists()
|
||||
|
||||
response = await client.post("/api/flows/sync")
|
||||
assert response.json()["skipped"] == ["simple_rule"]
|
||||
|
||||
|
||||
async def test_sync_endpoint_pull_error_continues(
|
||||
client, lfx_server, tmp_path, monkeypatch, login, override_langflow
|
||||
):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue