All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m33s
Merges full history from art-dag/mono.git into the monorepo under the artdag/ directory. Contains: core (DAG engine), l1 (Celery rendering server), l2 (ActivityPub registry), common (shared templates/middleware), client (CLI), test (e2e). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> git-subtree-dir: artdag git-subtree-mainline:1a179de547git-subtree-split:4c2e716558
94 lines
2.4 KiB
Python
94 lines
2.4 KiB
Python
"""
|
|
Pytest fixtures for art-celery tests.
|
|
"""
|
|
|
|
import pytest
|
|
from typing import Any, Dict, List
|
|
|
|
|
|
@pytest.fixture
|
|
def sample_compiled_nodes() -> List[Dict[str, Any]]:
|
|
"""Sample nodes as produced by the S-expression compiler."""
|
|
return [
|
|
{
|
|
"id": "source_1",
|
|
"type": "SOURCE",
|
|
"config": {"asset": "cat"},
|
|
"inputs": [],
|
|
"name": None,
|
|
},
|
|
{
|
|
"id": "source_2",
|
|
"type": "SOURCE",
|
|
"config": {
|
|
"input": True,
|
|
"name": "Second Video",
|
|
"description": "A user-provided video",
|
|
},
|
|
"inputs": [],
|
|
"name": "second-video",
|
|
},
|
|
{
|
|
"id": "effect_1",
|
|
"type": "EFFECT",
|
|
"config": {"effect": "identity"},
|
|
"inputs": ["source_1"],
|
|
"name": None,
|
|
},
|
|
{
|
|
"id": "effect_2",
|
|
"type": "EFFECT",
|
|
"config": {"effect": "invert", "intensity": 1.0},
|
|
"inputs": ["source_2"],
|
|
"name": None,
|
|
},
|
|
{
|
|
"id": "sequence_1",
|
|
"type": "SEQUENCE",
|
|
"config": {},
|
|
"inputs": ["effect_1", "effect_2"],
|
|
"name": None,
|
|
},
|
|
]
|
|
|
|
|
|
@pytest.fixture
|
|
def sample_registry() -> Dict[str, Dict[str, Any]]:
|
|
"""Sample registry with assets and effects."""
|
|
return {
|
|
"assets": {
|
|
"cat": {
|
|
"cid": "QmXrj6tSSn1vQXxxEY2Tyoudvt4CeeqR9gGQwSt7WFrhMZ",
|
|
"url": "https://example.com/cat.jpg",
|
|
},
|
|
},
|
|
"effects": {
|
|
"identity": {
|
|
"cid": "QmcWhw6wbHr1GDmorM2KDz8S3yCGTfjuyPR6y8khS2tvko",
|
|
},
|
|
"invert": {
|
|
"cid": "QmPWaW5E5WFrmDjT6w8enqvtJhM8c5jvQu7XN1doHA3Z7J",
|
|
},
|
|
},
|
|
}
|
|
|
|
|
|
@pytest.fixture
|
|
def sample_recipe(
|
|
sample_compiled_nodes: List[Dict[str, Any]],
|
|
sample_registry: Dict[str, Dict[str, Any]],
|
|
) -> Dict[str, Any]:
|
|
"""Sample compiled recipe."""
|
|
return {
|
|
"name": "test-recipe",
|
|
"version": "1.0",
|
|
"description": "A test recipe",
|
|
"owner": "@test@example.com",
|
|
"registry": sample_registry,
|
|
"dag": {
|
|
"nodes": sample_compiled_nodes,
|
|
"output": "sequence_1",
|
|
},
|
|
"recipe_id": "Qmtest123",
|
|
}
|