From 46e985883001a86e533cf66981394d9de35d883e Mon Sep 17 00:00:00 2001 From: AI Christianson Date: Wed, 11 Dec 2024 14:50:40 -0500 Subject: [PATCH] moar cowboy --- ra_aid/console/cowboy_messages.py | 5 ++++- ra_aid/tools/shell.py | 6 +++--- tests/ra_aid/console/test_cowboy_messages.py | 5 +++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ra_aid/console/cowboy_messages.py b/ra_aid/console/cowboy_messages.py index e881c72..969ab1f 100644 --- a/ra_aid/console/cowboy_messages.py +++ b/ra_aid/console/cowboy_messages.py @@ -5,7 +5,10 @@ COWBOY_MESSAGES = [ "Yippee ki yay motherfucker! 🤠", "Saddle up partner! 🤠", "This ain't my first rodeo! 🤠", - "Lock and load, partner! 🤠" + "Lock and load, partner! 🤠", + "i'll do my best not to fuck it up 🤠", + "I'm just a baby 👶", + "i'll try not to destroy everything 😏" ] def get_cowboy_message() -> str: diff --git a/ra_aid/tools/shell.py b/ra_aid/tools/shell.py index 7dc3527..180d644 100644 --- a/ra_aid/tools/shell.py +++ b/ra_aid/tools/shell.py @@ -40,14 +40,14 @@ def run_shell_command(command: str) -> Dict[str, Union[str, int, bool]]: - return_code: The process return code (0 typically means success) - success: Boolean indicating if the command succeeded (return code == 0) """ - # Show just the command in a simple panel - console.print(Panel(command, title="🐚 Shell", border_style="bright_yellow")) - # Check if we need approval cowboy_mode = _global_memory.get('config', {}).get('cowboy_mode', False) if cowboy_mode: console.print(get_cowboy_message()) + + # Show just the command in a simple panel + console.print(Panel(command, title="🐚 Shell", border_style="bright_yellow")) if not cowboy_mode: if not Confirm.ask("Execute this command?", default=True): diff --git a/tests/ra_aid/console/test_cowboy_messages.py b/tests/ra_aid/console/test_cowboy_messages.py index cbcf156..f023068 100644 --- a/tests/ra_aid/console/test_cowboy_messages.py +++ b/tests/ra_aid/console/test_cowboy_messages.py @@ -8,9 +8,10 @@ def test_get_cowboy_message_returns_string(): assert len(message) > 0 def test_cowboy_message_contains_emoji(): - """Test that returned message contains the cowboy emoji""" + """Test that returned message contains at least one of the expected emojis""" message = get_cowboy_message() - assert '🤠' in message + expected_emojis = ['🤠', '👶', '😏'] + assert any(emoji in message for emoji in expected_emojis) def test_message_from_predefined_list(): """Test that returned message is from our predefined list"""