refactor: add static source provider seam

This commit is contained in:
lda
2026-06-12 09:59:39 +07:00 Verified
parent dee95c89d2
commit bad3dbae0c
9 changed files with 148 additions and 17 deletions
+16 -1
View File
@@ -4,7 +4,15 @@ from pathlib import Path
import pytest
from wf_sources_python import load_python_source
from wf_sources_python import PythonSourceProvider, load_python_source
class PythonSourceConfigFixture:
id = "local.ops"
path = Path(".")
module = "tests.fixtures.python_source_ops"
registry = "registry"
enabled = True
def test_load_python_source_from_sequence_registry() -> None:
@@ -23,6 +31,13 @@ def test_load_python_source_from_sequence_registry() -> None:
assert source.permissions.safe_for_workflow is True
def test_python_source_provider_loads_configured_sources() -> None:
sources = PythonSourceProvider([PythonSourceConfigFixture()]).load_sources()
assert set(sources) == {"local.ops"}
assert "local.ops.echo" in sources["local.ops"].capabilities.node_specs
def test_load_python_source_from_callable_registry() -> None:
source = load_python_source(
source_id="local.ops",