Skip to content

Commit 123e23b

Browse files
committed
test: update test mocks to use new bot class
1 parent 756171b commit 123e23b

1 file changed

Lines changed: 25 additions & 17 deletions

File tree

tests/test_llm.py

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
import pytest
77

8-
from balatrollm.llm import Config, LLMBot
8+
from balatrollm.bot import LLMBot
9+
from balatrollm.config import Config
910

1011

1112
class TestConfig:
@@ -57,20 +58,20 @@ def config(self):
5758
@pytest.fixture
5859
def mock_balatro_client(self):
5960
"""Mock BalatroClient."""
60-
with patch("balatrollm.llm.BalatroClient") as mock:
61+
with patch("balatrollm.bot.BalatroClient") as mock:
6162
yield mock.return_value
6263

6364
@pytest.fixture
6465
def bot(self, config, mock_balatro_client):
6566
"""Test bot instance."""
66-
with patch("balatrollm.llm.AsyncOpenAI"):
67+
with patch("balatrollm.bot.AsyncOpenAI"):
6768
return LLMBot(config)
6869

6970
def test_bot_initialization(self, config):
7071
"""Test bot initializes correctly."""
7172
with (
72-
patch("balatrollm.llm.AsyncOpenAI") as mock_openai,
73-
patch("balatrollm.llm.BalatroClient") as mock_client,
73+
patch("balatrollm.bot.AsyncOpenAI") as mock_openai,
74+
patch("balatrollm.bot.BalatroClient") as mock_client,
7475
):
7576
bot = LLMBot(config)
7677

@@ -80,18 +81,25 @@ def test_bot_initialization(self, config):
8081
)
8182
mock_client.assert_called_once()
8283

83-
def test_generate_save_path(self, bot):
84-
"""Test save path generation."""
85-
with patch.object(bot, "project_version", "1.0.0"):
86-
path = bot._generate_save_path("Red Deck", 1, "TEST123")
87-
88-
assert "v1.0.0" in str(path)
89-
assert "test-model" in str(path)
90-
assert "default" in str(path)
91-
assert "RedDeck" in str(path)
92-
assert "s1" in str(path)
93-
assert "TEST123" in str(path)
94-
assert path.suffix == ".jsonl"
84+
def test_run_directory_generation(self, bot):
85+
"""Test run directory generation."""
86+
from balatrollm.data_collection import generate_run_directory
87+
88+
path = generate_run_directory(
89+
deck="Red Deck",
90+
stake=1,
91+
seed="TEST123",
92+
model="test-model",
93+
template="default",
94+
project_version="1.0.0",
95+
)
96+
97+
assert "v1.0.0" in str(path)
98+
assert "test-model" in str(path)
99+
assert "default" in str(path)
100+
assert "RedDeck" in str(path)
101+
assert "s1" in str(path)
102+
assert "TEST123" in str(path)
95103

96104
def test_get_tools_for_state(self, bot):
97105
"""Test tools selection for different states."""

0 commit comments

Comments
 (0)