Add test_credentials.py for Penpot API credential verification and project listing
- Introduced a new script, `test_credentials.py`, to verify Penpot API credentials and list associated projects. - The script loads environment variables, checks for required credentials, and attempts to authenticate with the Penpot API. - Added functionality to fetch and display project details and files, including error handling for authentication and project retrieval. - Updated `PenpotAPI` class to include a User-Agent header and improved error handling during profile retrieval. - Minor adjustments in import order across various modules for consistency.
This commit is contained in:
@@ -3,9 +3,12 @@ Tests for the memory caching functionality.
|
||||
"""
|
||||
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
from penpot_mcp.utils.cache import MemoryCache
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def memory_cache():
|
||||
"""Create a MemoryCache instance with a short TTL for testing."""
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
"""Tests for the MCP server module."""
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import hashlib
|
||||
from unittest.mock import MagicMock, mock_open, patch
|
||||
|
||||
import yaml
|
||||
import pytest
|
||||
import yaml
|
||||
|
||||
from penpot_mcp.server.mcp_server import PenpotMCPServer, create_server
|
||||
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@ import pytest
|
||||
from anytree import Node, RenderTree
|
||||
|
||||
from penpot_mcp.tools.penpot_tree import (
|
||||
build_tree,
|
||||
print_tree,
|
||||
export_tree_to_dot,
|
||||
find_page_containing_object,
|
||||
find_object_in_tree,
|
||||
convert_node_to_dict,
|
||||
build_tree,
|
||||
convert_node_to_dict,
|
||||
export_tree_to_dot,
|
||||
find_object_in_tree,
|
||||
find_page_containing_object,
|
||||
get_object_subtree,
|
||||
get_object_subtree_with_fields
|
||||
get_object_subtree_with_fields,
|
||||
print_tree,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user