Skip to main content
Glama
by fkesheh
test_file_service.pyโ€ข1.36 kB
"""Tests for file service.""" import pytest from skill_mcp.core.exceptions import FileNotFoundError, ProtectedFileError, SkillNotFoundError from skill_mcp.services.file_service import FileService def test_list_skill_files_nonexistent_skill(temp_skills_dir, monkeypatch): """Test listing files for nonexistent skill.""" with pytest.raises(SkillNotFoundError): FileService.list_skill_files("nonexistent-skill") def test_read_nonexistent_file(sample_skill, temp_skills_dir): """Test reading nonexistent file.""" with pytest.raises(FileNotFoundError): FileService.read_file("test-skill", "nonexistent.txt") def test_delete_nonexistent_file(sample_skill, temp_skills_dir): """Test deleting nonexistent file.""" with pytest.raises(FileNotFoundError): FileService.delete_file("test-skill", "nonexistent.txt") def test_list_skill_files_has_files(sample_skill, temp_skills_dir): """Test listing files returns results.""" files = FileService.list_skill_files("test-skill") assert len(files) > 0 assert any("SKILL.md" in f["path"] for f in files) def test_delete_protected_skill_md(sample_skill, temp_skills_dir): """Test that SKILL.md cannot be deleted.""" with pytest.raises(ProtectedFileError, match="Cannot delete 'SKILL.md'"): FileService.delete_file("test-skill", "SKILL.md")

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fkesheh/skill-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server