import unittest
from slack_bot.tools.web import WebSearchTool

class TestWebSearch(unittest.TestCase):
    def test_search_execution(self):
        """Test that search returns results (requires internet)."""
        # This is an integration test, relying on DDPS availability.
        # We'll just check if it returns a non-error string processing known query.
        
        try:
            result = WebSearchTool.search_web("latest Python version", max_results=2)
            print(f"DEBUG SEARCH RESULT:\n{result}")
            
            self.assertIn("Python", result)
            self.assertNotIn("Error", result)
            
        except Exception as e:
            # If network is down, we might want to skip or fail gracefully
            print(f"Skipping test due to network/lib error: {e}")

if __name__ == '__main__':
    unittest.main()
