degrade optional workspace writes safely
This commit is contained in:
@@ -115,6 +115,25 @@ def test_invalid_schema_returns_structured_validation_error():
|
||||
assert "type='object'" in " ".join(result.warnings)
|
||||
|
||||
|
||||
def test_optional_workspace_write_is_skipped_without_a_workspace():
|
||||
class NoWorkspaceContext:
|
||||
@property
|
||||
def workspace(self):
|
||||
raise PermissionError("no workspace bound")
|
||||
|
||||
warnings = []
|
||||
asyncio.run(
|
||||
agent_module._write_workspace_output(
|
||||
NoWorkspaceContext(),
|
||||
"outputs/data-workflows/test.workflow.json",
|
||||
{"ok": True},
|
||||
warnings,
|
||||
)
|
||||
)
|
||||
|
||||
assert warnings == ["workspace write skipped: no workspace bound"]
|
||||
|
||||
|
||||
def test_workflow_spec_has_no_secret_fields():
|
||||
schema = {"type": "object", "properties": {"Name": {"type": "string"}}, "required": ["Name"]}
|
||||
profile = agent_module._profile_source_data("x.csv", "text/csv", b"Name\nAda\n")
|
||||
|
||||
Reference in New Issue
Block a user