Files
sama/tests/test_agents/test_logic.py
T
Celes Renata 57619860d5 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
2026-08-02 03:29:55 -07:00

28 lines
767 B
Python

"""
Tests for LogicAgent.
"""
import pytest
from dcos.agents.logic import LogicAgent
class TestLogicAgent:
def test_infer_with_premises(self):
agent = LogicAgent()
conclusion = agent.infer(["A", "B"])
assert conclusion != "insufficient_premises"
def test_infer_empty(self):
agent = LogicAgent()
conclusion = agent.infer([])
assert conclusion == "insufficient_premises"
def test_act(self):
agent = LogicAgent()
result = agent.act({"premises": ["all humans are mortal", "Socrates is human"]})
assert result["valid"] is True
def test_contradiction_detection(self):
agent = LogicAgent()
assert agent.detect_contradiction(["A", "not A"]) is False # placeholder