Tests for real-world usage scenarios.
| 173 | |
| 174 | |
| 175 | class TestRealWorldScenarios: |
| 176 | """Tests for real-world usage scenarios.""" |
| 177 | |
| 178 | def test_step_header(self): |
| 179 | """Test Step header formatting (from agent.py).""" |
| 180 | step = 1 |
| 181 | max_steps = 50 |
| 182 | step_text = f"💭 Step {step}/{max_steps}" |
| 183 | |
| 184 | width = calculate_display_width(step_text) |
| 185 | # "💭" (2) + " Step 1/50" (10) = 12 |
| 186 | assert width == 12 |
| 187 | |
| 188 | def test_session_info_model(self): |
| 189 | """Test Session Info model line.""" |
| 190 | model = "minimax-01" |
| 191 | line = f"Model: {model}" |
| 192 | width = calculate_display_width(line) |
| 193 | # Should calculate correctly regardless of model name |
| 194 | assert width > 0 |
| 195 | |
| 196 | def test_chinese_model_name(self): |
| 197 | """Test with Chinese model name.""" |
| 198 | model = "模型-01" |
| 199 | line = f"Model: {model}" |
| 200 | width = calculate_display_width(line) |
| 201 | # "Model: " (7) + "模型-01" (2+2+3) = 14 |
| 202 | assert width == 14 |
| 203 | |
| 204 | def test_banner_text(self): |
| 205 | """Test banner text from cli.py.""" |
| 206 | banner = "🤖 Mini Agent - Multi-turn Interactive Session" |
| 207 | width = calculate_display_width(banner) |
| 208 | # "🤖" (2) + " Mini Agent - Multi-turn Interactive Session" (44) = 46 |
| 209 | assert width == 46 |
nothing calls this directly
no outgoing calls
no test coverage detected