import pytest from mcp_server_hello_world.server import HelloWorldServer class TestHelloWorldServer: """Test the HelloWorldServer class functionality.""" def test_init(self): """Test that the server initializes with the correct welcome message.""" server = HelloWorldServer() assert server.welcome_message == "Welcome to the Hello World MCP Server! This is a simple static resource." def test_get_greeting(self): """Test that the get_greeting method returns the correct greeting.""" server = HelloWorldServer() name = "Test User" expected_greeting = f"Hello, {name}! Welcome to the Hello World MCP Server." assert server.get_greeting(name) == expected_greeting # Test with different name another_name = "Another User" expected_greeting = f"Hello, {another_name}! Welcome to the Hello World MCP Server." assert server.get_greeting(another_name) == expected_greeting