We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/technohead/smartthings-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
test_integration.py•2.83 kB
"""
Integration tests for SmartThingsMCP.
These tests require a running SmartThings API and authentication token.
Run with: pytest -m integration tests/
"""
import pytest
import os
from unittest.mock import Mock, patch
pytestmark = pytest.mark.integration
class TestIntegrationDeviceOperations:
"""Integration tests for device operations."""
@pytest.mark.requires_auth
def test_list_devices_integration(self):
"""Test listing devices with real API (requires auth token)."""
token = os.environ.get("SMARTTHINGS_AUTH_TOKEN")
if not token:
pytest.skip("SMARTTHINGS_AUTH_TOKEN not set")
# This would be an actual API call in integration test
assert token is not None
@pytest.mark.requires_auth
def test_get_device_status_integration(self):
"""Test getting device status with real API."""
token = os.environ.get("SMARTTHINGS_AUTH_TOKEN")
if not token:
pytest.skip("SMARTTHINGS_AUTH_TOKEN not set")
# Would make actual API call
assert token is not None
class TestIntegrationRuleOperations:
"""Integration tests for rule operations."""
@pytest.mark.requires_auth
def test_list_rules_integration(self):
"""Test listing rules with real API."""
token = os.environ.get("SMARTTHINGS_AUTH_TOKEN")
if not token:
pytest.skip("SMARTTHINGS_AUTH_TOKEN not set")
assert token is not None
@pytest.mark.requires_auth
def test_create_rule_integration(self):
"""Test creating a rule with real API."""
token = os.environ.get("SMARTTHINGS_AUTH_TOKEN")
if not token:
pytest.skip("SMARTTHINGS_AUTH_TOKEN not set")
assert token is not None
class TestServerStartup:
"""Test server startup and initialization."""
def test_server_initialization(self):
"""Test server initialization."""
# Test that the server module can be imported
try:
from SmartThingsMCP.SmartThingsMCPServer import SmartThingsMCPServer
assert SmartThingsMCPServer is not None
except ImportError:
# If direct import fails, just skip
pytest.skip("SmartThingsMCPServer import not available")
class TestClientConnection:
"""Test client connection to server."""
def test_client_connection(self):
"""Test client connection to server."""
# Test that the client module can be imported
try:
from SmartThingsMCP.SmartThingsMCPClient import SmartThingsMCPClient
assert SmartThingsMCPClient is not None
except ImportError:
# If direct import fails, just skip
pytest.skip("SmartThingsMCPClient import not available")