From 8a71971d99d95e1c2b42568488d45bbbf2195487 Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Thu, 10 Apr 2025 20:28:04 -0500 Subject: [PATCH] Create test_news_manager.py need a test script to call upon --- test_news_manager.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 test_news_manager.py diff --git a/test_news_manager.py b/test_news_manager.py new file mode 100644 index 00000000..e70d8913 --- /dev/null +++ b/test_news_manager.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 +import time +import sys +import os +from src.config_manager import ConfigManager +from src.display_manager import DisplayManager +from src.news_manager import NewsManager + +def main(): + """Test the NewsManager class directly.""" + try: + # Load configuration + config_manager = ConfigManager() + config = config_manager.load_config() + + # Initialize display manager + display_manager = DisplayManager(config.get('display', {})) + + # Initialize news manager + news_manager = NewsManager(config, display_manager) + + # Test the scrolling behavior + # You can customize these parameters: + # - test_message: The message to scroll + # - scroll_speed: Pixels to move per frame (higher = faster) + # - scroll_delay: Delay between scroll updates (lower = faster) + # - max_iterations: Maximum number of iterations to run (None = run indefinitely) + news_manager.test_scroll( + test_message="This is a test of the NewsManager scrolling behavior. You can adjust the speed and delay to find the optimal settings.", + scroll_speed=2, # Adjust this to change scroll speed + scroll_delay=0.05, # Adjust this to change scroll smoothness + max_iterations=3 # Set to None to run indefinitely + ) + + except KeyboardInterrupt: + print("\nTest interrupted by user") + except Exception as e: + print(f"Error during test: {e}") + finally: + print("Test completed") + +if __name__ == "__main__": + main() \ No newline at end of file