Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions tests/openviking_plugin/test_openviking.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests for plugins/memory/openviking/__init__.py — URI normalization and payload handling."""

import json
from typing import Any, cast

import plugins.memory.openviking as openviking_plugin
from plugins.memory.openviking import OpenVikingMemoryProvider
Expand Down Expand Up @@ -127,7 +128,7 @@ def test_queue_prefetch_searches_only_slash_skill_user_instruction(self, monkeyp
RecordingVikingClient.calls = []
monkeypatch.setattr(openviking_plugin, "_VikingClient", RecordingVikingClient)
provider = OpenVikingMemoryProvider()
provider._client = object()
provider._client = cast(Any, object())
provider._endpoint = "http://openviking.test"
provider._api_key = ""
provider._account = "default"
Expand All @@ -143,6 +144,7 @@ def test_queue_prefetch_searches_only_slash_skill_user_instruction(self, monkeyp
)

provider.queue_prefetch(skill_message)
assert provider._prefetch_thread is not None
provider._prefetch_thread.join(timeout=5.0)

assert RecordingVikingClient.calls == [
Expand All @@ -156,7 +158,7 @@ def test_queue_prefetch_searches_only_skill_bundle_user_instruction(self, monkey
RecordingVikingClient.calls = []
monkeypatch.setattr(openviking_plugin, "_VikingClient", RecordingVikingClient)
provider = OpenVikingMemoryProvider()
provider._client = object()
provider._client = cast(Any, object())
provider._endpoint = "http://openviking.test"
provider._api_key = ""
provider._account = "default"
Expand All @@ -173,6 +175,7 @@ def test_queue_prefetch_searches_only_skill_bundle_user_instruction(self, monkey
)

provider.queue_prefetch(skill_message)
assert provider._prefetch_thread is not None
provider._prefetch_thread.join(timeout=5.0)

assert RecordingVikingClient.calls == [
Expand All @@ -186,7 +189,7 @@ def test_queue_prefetch_skips_slash_skill_without_user_instruction(self, monkeyp
RecordingVikingClient.calls = []
monkeypatch.setattr(openviking_plugin, "_VikingClient", RecordingVikingClient)
provider = OpenVikingMemoryProvider()
provider._client = object()
provider._client = cast(Any, object())
skill_message = (
'[IMPORTANT: The user has invoked the "skill-creator" skill, indicating they want '
"you to follow its instructions. The full skill content is loaded below.]\n\n"
Expand All @@ -203,7 +206,7 @@ def test_sync_turn_stores_only_slash_skill_user_instruction(self, monkeypatch):
RecordingVikingClient.calls = []
monkeypatch.setattr(openviking_plugin, "_VikingClient", RecordingVikingClient)
provider = OpenVikingMemoryProvider()
provider._client = object()
provider._client = cast(Any, object())
provider._endpoint = "http://openviking.test"
provider._api_key = ""
provider._account = "default"
Expand All @@ -220,6 +223,7 @@ def test_sync_turn_stores_only_slash_skill_user_instruction(self, monkeypatch):
)

provider.sync_turn(skill_message, "Done.")
assert provider._sync_thread is not None
provider._sync_thread.join(timeout=5.0)

assert RecordingVikingClient.calls == [
Expand All @@ -237,7 +241,7 @@ def test_sync_turn_skips_slash_skill_without_user_instruction(self, monkeypatch)
RecordingVikingClient.calls = []
monkeypatch.setattr(openviking_plugin, "_VikingClient", RecordingVikingClient)
provider = OpenVikingMemoryProvider()
provider._client = object()
provider._client = cast(Any, object())
skill_message = (
'[IMPORTANT: The user has invoked the "skill-creator" skill, indicating they want '
"you to follow its instructions. The full skill content is loaded below.]\n\n"
Expand Down
Loading