feat: implement DCOS source tree, tests, and build configuration
Complete implementation of the DCOS package including: - 40+ Python source files across agents, communication, core, learning, memory, protocols, utils - pyproject.toml build configuration - 102 unit tests across all subsystems - Fixed flake.nix (Python 3.12, proper dependencies, pyproject build) - Fixed .woodpecker.yml (correct paths, removed silent-fail flags) - Added .gitignore - Cleared stale pytest cache
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
"""
|
||||
Tests for ProceduralMemory.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
from dcos.memory.procedural import ProceduralMemory
|
||||
|
||||
|
||||
class TestProceduralMemory:
|
||||
def test_register_procedure(self):
|
||||
mem = ProceduralMemory()
|
||||
mem.register_procedure("build", ["init", "compile", "link"])
|
||||
proc = mem.get_procedure("build")
|
||||
assert proc is not None
|
||||
assert len(proc["steps"]) == 3
|
||||
|
||||
def test_execute_procedure(self):
|
||||
mem = ProceduralMemory()
|
||||
mem.register_procedure("test_proc", ["step1", "step2"])
|
||||
result = mem.execute_procedure("test_proc", {})
|
||||
assert result["executed"] is True
|
||||
|
||||
def test_missing_procedure(self):
|
||||
mem = ProceduralMemory()
|
||||
with pytest.raises(KeyError):
|
||||
mem.execute_procedure("nonexistent", {})
|
||||
|
||||
def test_list_procedures(self):
|
||||
mem = ProceduralMemory()
|
||||
mem.register_procedure("a", ["a1"])
|
||||
mem.register_procedure("b", ["b1"])
|
||||
procs = mem.list_procedures()
|
||||
assert len(procs) == 2
|
||||
Reference in New Issue
Block a user