mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-22 06:18:14 +00:00
refactor: Implement code review suggestions for emoji disable feature
- Move EMOJI_MAP to module level as DEFAULT_EMOJI_MAP for memory efficiency - Add _parse_bool_env() helper function for cleaner boolean conversion - Implement performance optimization with icon caching - Improve error handling for unknown emojis with better fallback format - Update tests to work with new module structure - All functionality preserved and tests passing Addresses feedback from PR review #3063 Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -96,11 +96,11 @@ class TestConsoleFormatterEmojiDisable:
|
||||
assert formatter._get_icon(emoji) == expected_text
|
||||
|
||||
def test_unknown_emoji_fallback(self):
|
||||
"""Test that unknown emojis fall back to ASCII-only representation."""
|
||||
"""Test that unknown emojis fall back to proper representation."""
|
||||
with patch.dict(os.environ, {"CREWAI_DISABLE_EMOJIS": "true"}):
|
||||
formatter = ConsoleFormatter(verbose=True)
|
||||
result = formatter._get_icon("🦄")
|
||||
assert result == ""
|
||||
assert result == "[ICON:UNKNOWN]"
|
||||
|
||||
@patch.dict(os.environ, {"CREWAI_DISABLE_EMOJIS": "true"})
|
||||
def test_crew_tree_creation_without_emojis(self):
|
||||
|
||||
Reference in New Issue
Block a user