chore: update gitignore, Makefile, skills route, and test scaffolding

This commit is contained in:
zenfun
2026-02-16 02:38:01 +08:00
parent aa3b012d60
commit 963122b916
7 changed files with 266 additions and 6 deletions
+26 -3
View File
@@ -16,6 +16,26 @@ class _version_info:
self.major = major
self.minor = minor
def __ge__(self, other):
if isinstance(other, tuple):
return (self.major, self.minor) >= other[:2]
return NotImplemented
def __le__(self, other):
if isinstance(other, tuple):
return (self.major, self.minor) <= other[:2]
return NotImplemented
def __gt__(self, other):
if isinstance(other, tuple):
return (self.major, self.minor) > other[:2]
return NotImplemented
def __lt__(self, other):
if isinstance(other, tuple):
return (self.major, self.minor) < other[:2]
return NotImplemented
def test_check_env(monkeypatch):
version_info_correct = _version_info(3, 10)
@@ -23,9 +43,12 @@ def test_check_env(monkeypatch):
monkeypatch.setattr(sys, "version_info", version_info_correct)
with mock.patch("os.makedirs") as mock_makedirs:
check_env()
mock_makedirs.assert_any_call("data/config", exist_ok=True)
mock_makedirs.assert_any_call("data/plugins", exist_ok=True)
mock_makedirs.assert_any_call("data/temp", exist_ok=True)
# check_env uses get_astrbot_*_path() which returns absolute paths,
# so just verify makedirs was called the expected number of times
assert mock_makedirs.call_count >= 4
# Verify all calls used exist_ok=True
for call_args in mock_makedirs.call_args_list:
assert call_args[1].get("exist_ok") is True
monkeypatch.setattr(sys, "version_info", version_info_wrong)
with pytest.raises(SystemExit):
+2
View File
@@ -40,6 +40,7 @@ def plugin_manager_pm(tmp_path):
persona_manager = MagicMock()
astrbot_config_mgr = MagicMock()
knowledge_base_manager = MagicMock()
cron_manager = MagicMock()
star_context = Context(
event_queue,
@@ -52,6 +53,7 @@ def plugin_manager_pm(tmp_path):
persona_manager,
astrbot_config_mgr,
knowledge_base_manager=knowledge_base_manager,
cron_manager=cron_manager,
)
# Create the PluginManager instance