Refactor test cases for improved readability and consistency

- Added blank lines for better separation of test cases in multiple test files.
- Reformatted event handling in tests for clarity and consistency.
- Ensured consistent use of multi-line formatting for dictionary arguments in event handling.
- Improved assertions and test descriptions for better understanding.
- Updated test cases across various modules including test_stream_state, test_stream_utils, test_summarization, test_thread_selector, test_tool_error_handler, test_tui_widgets, test_ui_runtime, and test_wechat_channel.
This commit is contained in:
X-iZhang
2026-03-15 21:12:51 +00:00
parent f27521d62b
commit c5a4d559a2
116 changed files with 4592 additions and 2236 deletions
+5
View File
@@ -17,6 +17,7 @@ from EvoScientist.stream.diff_format import (
# _escape_markup
# ---------------------------------------------------------------------------
class TestEscapeMarkup:
def test_escapes_brackets(self):
assert _escape_markup("[bold]text[/bold]") == r"\[bold\]text\[/bold\]"
@@ -35,6 +36,7 @@ class TestEscapeMarkup:
# _detect_unicode_support
# ---------------------------------------------------------------------------
class TestDetectUnicodeSupport:
def test_utf8_encoding(self):
with mock.patch("sys.stdout") as mock_stdout:
@@ -60,6 +62,7 @@ class TestDetectUnicodeSupport:
# format_diff_rich
# ---------------------------------------------------------------------------
class TestFormatDiffRich:
def test_empty_diff_returns_dim_message(self):
result = format_diff_rich("")
@@ -143,6 +146,7 @@ class TestFormatDiffRich:
# build_edit_diff
# ---------------------------------------------------------------------------
class TestBuildEditDiff:
def test_returns_none_when_equal(self):
assert build_edit_diff("/foo.py", "same", "same") is None
@@ -195,6 +199,7 @@ class TestBuildEditDiff:
# Integration with format_tool_result_compact
# ---------------------------------------------------------------------------
class TestFormatToolResultCompactEditFile:
def test_edit_file_with_tool_args_shows_diff(self):
from EvoScientist.stream.display import format_tool_result_compact