Skip to content

Commit b6271cb

Browse files
committed
test: update tests to match removed auto_save config option
- Remove auto_save parameter from DisplayManager tests - Remove auto_save assertions from ChatConfig tests - Remove auto_save from ChatLoop initialization tests - Remove auto_save prompts from config wizard tests - Update display banner test to expect 'always enabled' message - All 318 tests now passing
1 parent 2361f2d commit b6271cb

4 files changed

Lines changed: 11 additions & 24 deletions

File tree

tests/unit/test_chat_config.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def agent_override_config(tmp_path):
4242
'Test Agent':
4343
features:
4444
show_tokens: true
45-
auto_save: true
4645
'Another Agent':
4746
behavior:
4847
max_retries: 10
@@ -59,7 +58,6 @@ def test_defaults_loaded(self):
5958
config = ChatConfig()
6059

6160
assert config.get("features.show_tokens") is True
62-
assert config.get("features.auto_save") is True
6361
assert config.get("features.rich_enabled") is True
6462
assert config.get("behavior.max_retries") == 3
6563
assert config.get("ui.show_banner") is True
@@ -117,7 +115,6 @@ def test_get_agent_override(self, agent_override_config):
117115

118116
# Agent-specific override
119117
assert config.get("features.show_tokens", agent_name="Test Agent") is True
120-
assert config.get("features.auto_save", agent_name="Test Agent") is True
121118

122119
# Different agent
123120
assert config.get("behavior.max_retries", agent_name="Another Agent") == 10
@@ -160,7 +157,6 @@ def test_get_section_with_agent_override(self, agent_override_config):
160157
# Agent-specific section
161158
agent_features = config.get_section("features", agent_name="Test Agent")
162159
assert agent_features["show_tokens"] is True
163-
assert agent_features["auto_save"] is True
164160

165161
def test_get_colors_section_decodes_escapes(self, tmp_path, monkeypatch):
166162
"""Test that colors section contains valid color values."""
@@ -202,13 +198,13 @@ def test_set_agent_specific_value(self):
202198
"""Test setting agent-specific configuration."""
203199
config = ChatConfig()
204200

205-
config.set("features.auto_save", False, agent_name="My Agent")
201+
config.set("features.show_tokens", False, agent_name="My Agent")
206202

207203
# Global should remain unchanged (default is True now)
208-
assert config.get("features.auto_save") is True
204+
assert config.get("features.show_tokens") is True
209205

210206
# Agent-specific should be set
211-
assert config.get("features.auto_save", agent_name="My Agent") is False
207+
assert config.get("features.show_tokens", agent_name="My Agent") is False
212208

213209

214210
class TestConfigMerging:

tests/unit/test_chat_loop_utils.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def test_initialization_with_defaults(self, mock_agent):
9393
assert chat_loop.retry_delay == 2.0
9494
assert chat_loop.timeout == 120.0
9595
assert chat_loop.spinner_style == "dots"
96-
assert chat_loop.auto_save is False
9796
assert chat_loop.show_metadata is True
9897
assert chat_loop.show_thinking is True
9998
assert chat_loop.show_duration is True
@@ -107,7 +106,6 @@ def test_initialization_with_config(self, mock_agent, tmp_path):
107106
"behavior.retry_delay": 3.0,
108107
"behavior.timeout": 180.0,
109108
"behavior.spinner_style": "bouncingBall",
110-
"features.auto_save": True,
111109
"features.show_metadata": False,
112110
"features.show_tokens": True,
113111
"features.rich_enabled": False,
@@ -130,7 +128,6 @@ def test_initialization_with_config(self, mock_agent, tmp_path):
130128
assert chat_loop.retry_delay == 3.0
131129
assert chat_loop.timeout == 180.0
132130
assert chat_loop.spinner_style == "bouncingBall"
133-
assert chat_loop.auto_save is True
134131
assert chat_loop.show_metadata is False
135132
assert chat_loop.show_tokens is True
136133
assert chat_loop.use_rich is False # Rich disabled by config

tests/unit/test_config_wizard.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def temp_config_file(tmp_path):
3434
reset: '\\033[0m'
3535
3636
features:
37-
auto_save: false
3837
show_tokens: true
3938
show_metadata: true
4039
rich_enabled: true
@@ -351,7 +350,6 @@ def test_configure_features_all_defaults(self, mock_input, wizard):
351350
wizard._configure_features()
352351

353352
assert "features" in wizard.config
354-
assert "auto_save" in wizard.config["features"]
355353
assert "show_tokens" in wizard.config["features"]
356354
assert "show_metadata" in wizard.config["features"]
357355
assert "rich_enabled" in wizard.config["features"]
@@ -360,11 +358,11 @@ def test_configure_features_all_defaults(self, mock_input, wizard):
360358
@patch("builtins.input")
361359
def test_configure_features_custom_values(self, mock_input, wizard):
362360
"""Test configuring features with custom values."""
363-
mock_input.side_effect = ["y", "y", "n", "n", "y"]
361+
# Removed auto_save, so now only 4 prompts instead of 5
362+
mock_input.side_effect = ["y", "n", "n", "y"]
364363

365364
wizard._configure_features()
366365

367-
assert wizard.config["features"]["auto_save"] is True
368366
assert wizard.config["features"]["show_tokens"] is True
369367
assert wizard.config["features"]["show_metadata"] is False
370368
assert wizard.config["features"]["rich_enabled"] is False
@@ -562,7 +560,7 @@ def test_write_config_global_new_file(
562560
monkeypatch.setattr(Path, "home", lambda: tmp_path)
563561
wizard.config = {
564562
"colors": {"user": "bright_white"},
565-
"features": {"auto_save": False},
563+
"features": {"show_tokens": False},
566564
"ui": {},
567565
"audio": {"enabled": True, "notification_sound": None},
568566
"behavior": {},
@@ -666,7 +664,7 @@ def test_generate_yaml_includes_all_sections(self, wizard):
666664
"""Test that generated YAML includes all config sections."""
667665
wizard.config = {
668666
"colors": {"user": "bright_white"},
669-
"features": {"auto_save": False},
667+
"features": {"show_tokens": False},
670668
"ui": {"show_banner": True},
671669
"audio": {"enabled": True, "notification_sound": None},
672670
"behavior": {"max_retries": 3},
@@ -820,7 +818,6 @@ def test_reset_global_config_with_confirmation(
820818
content = result.read_text()
821819
assert "bright_white" in content
822820
assert "bright_blue" in content
823-
assert "auto_save: false" in content
824821
assert "show_tokens: false" in content
825822

826823
@patch("builtins.input")

tests/unit/test_display_manager.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def display_with_config():
4848
return DisplayManager(
4949
agent_name="Test Agent",
5050
agent_description="Test description",
51-
auto_save=True,
5251
config=config,
5352
)
5453

@@ -68,7 +67,6 @@ def test_initialization_defaults(self):
6867
assert display.show_banner is True
6968
assert display.show_metadata is False
7069
assert display.use_rich is False
71-
assert display.auto_save is False
7270
assert display.config is None
7371
assert display.status_bar is None
7472

@@ -85,15 +83,13 @@ def test_initialization_with_all_params(self):
8583
show_banner=False,
8684
show_metadata=True,
8785
use_rich=True,
88-
auto_save=True,
8986
config=config,
9087
status_bar=status_bar,
9188
)
9289

9390
assert display.show_banner is False
9491
assert display.show_metadata is True
9592
assert display.use_rich is True
96-
assert display.auto_save is True
9793
assert display.config is config
9894
assert display.status_bar is status_bar
9995

@@ -156,7 +152,7 @@ def test_display_banner_with_config(self, display_with_config, capsys):
156152
captured = capsys.readouterr()
157153

158154
assert "Configuration loaded" in captured.out
159-
assert "Auto-save: enabled" in captured.out
155+
assert "Auto-save: always enabled" in captured.out
160156

161157

162158
class TestDisplayHelp:
@@ -269,11 +265,12 @@ def test_display_info_with_config(self, display_with_config, capsys):
269265
assert "Configuration file support" in captured.out
270266

271267
def test_display_info_with_auto_save(self, display_with_config, capsys):
272-
"""Test info display with auto-save enabled."""
268+
"""Test info display shows auto-save always enabled."""
273269
display_with_config.display_info()
274270
captured = capsys.readouterr()
275271

276-
assert "Auto-save conversations" in captured.out
272+
# Auto-save is now always enabled, so should always appear
273+
assert "Auto-save conversations after each message" in captured.out
277274

278275

279276
class TestDisplaySessionSummary:

0 commit comments

Comments
 (0)