mirror of
https://github.com/magnus919/agent-skills.git
synced 2026-09-11 19:47:12 +03:00
Closes #61\n\nImplemented and independently reviewed with AI assistance from Jasper on behalf of Magnus Hedemark.
44 lines
1.0 KiB
Python
44 lines
1.0 KiB
Python
import importlib.util
|
|
import sys
|
|
import tempfile
|
|
import types
|
|
import unittest
|
|
from dataclasses import dataclass
|
|
from pathlib import Path
|
|
from unittest.mock import patch
|
|
|
|
|
|
yaml = types.ModuleType("yaml")
|
|
yaml.safe_load = lambda _: {}
|
|
sys.modules["yaml"] = yaml
|
|
|
|
state = types.ModuleType("agent_council.state")
|
|
|
|
|
|
@dataclass
|
|
class ProfileInfo:
|
|
name: str
|
|
description: str
|
|
soul_content: str
|
|
|
|
|
|
state.ProfileInfo = ProfileInfo
|
|
sys.modules["agent_council.state"] = state
|
|
|
|
select_spec = importlib.util.spec_from_file_location(
|
|
"select", Path(__file__).parents[1] / "agent_council" / "phases" / "select.py"
|
|
)
|
|
select = importlib.util.module_from_spec(select_spec)
|
|
select_spec.loader.exec_module(select)
|
|
|
|
|
|
class ProfileSelectionTests(unittest.TestCase):
|
|
def test_missing_profiles_are_empty_without_running_git(self):
|
|
with tempfile.TemporaryDirectory() as directory:
|
|
with patch.object(select, "PROFILES_DIR", Path(directory) / "profiles"):
|
|
self.assertEqual(select.load_all(), [])
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|