Buckets:
| """Tests for format and protocol skills - import and basic functionality.""" | |
| import tempfile | |
| from pathlib import Path | |
| import pytest | |
| from r_cli.core.config import Config | |
| def temp_dir(): | |
| """Create temporary directory for tests.""" | |
| with tempfile.TemporaryDirectory() as tmpdir: | |
| yield tmpdir | |
| def config(temp_dir): | |
| """Configuration for tests.""" | |
| cfg = Config() | |
| cfg.output_dir = temp_dir | |
| cfg.home_dir = temp_dir | |
| return cfg | |
| # ============================================================================= | |
| # Skill Import Tests | |
| # ============================================================================= | |
| class TestFormatSkillImports: | |
| """Test that all format skills can be imported.""" | |
| def test_url_skill_import(self): | |
| from r_cli.skills.url_skill import URLSkill | |
| assert URLSkill is not None | |
| def test_ip_skill_import(self): | |
| from r_cli.skills.ip_skill import IPSkill | |
| assert IPSkill is not None | |
| def test_encoding_skill_import(self): | |
| from r_cli.skills.encoding_skill import EncodingSkill | |
| assert EncodingSkill is not None | |
| def test_color_skill_import(self): | |
| from r_cli.skills.color_skill import ColorSkill | |
| assert ColorSkill is not None | |
| def test_semver_skill_import(self): | |
| from r_cli.skills.semver_skill import SemVerSkill | |
| assert SemVerSkill is not None | |
| def test_mime_skill_import(self): | |
| from r_cli.skills.mime_skill import MIMESkill | |
| assert MIMESkill is not None | |
| def test_html_skill_import(self): | |
| from r_cli.skills.html_skill import HTMLSkill | |
| assert HTMLSkill is not None | |
| def test_xml_skill_import(self): | |
| from r_cli.skills.xml_skill import XMLSkill | |
| assert XMLSkill is not None | |
| def test_jwt_skill_import(self): | |
| from r_cli.skills.jwt_skill import JWTSkill | |
| assert JWTSkill is not None | |
| # ============================================================================= | |
| # Skill Instantiation Tests | |
| # ============================================================================= | |
| class TestFormatSkillInstantiation: | |
| """Test that format skills can be instantiated.""" | |
| def test_url_skill(self, config): | |
| from r_cli.skills.url_skill import URLSkill | |
| skill = URLSkill(config) | |
| assert skill is not None | |
| assert skill.name == "url" | |
| def test_ip_skill(self, config): | |
| from r_cli.skills.ip_skill import IPSkill | |
| skill = IPSkill(config) | |
| assert skill is not None | |
| assert skill.name == "ip" | |
| def test_encoding_skill(self, config): | |
| from r_cli.skills.encoding_skill import EncodingSkill | |
| skill = EncodingSkill(config) | |
| assert skill is not None | |
| assert skill.name == "encoding" | |
| def test_color_skill(self, config): | |
| from r_cli.skills.color_skill import ColorSkill | |
| skill = ColorSkill(config) | |
| assert skill is not None | |
| assert skill.name == "color" | |
| def test_semver_skill(self, config): | |
| from r_cli.skills.semver_skill import SemVerSkill | |
| skill = SemVerSkill(config) | |
| assert skill is not None | |
| assert skill.name == "semver" | |
| def test_mime_skill(self): | |
| from r_cli.skills.mime_skill import MIMESkill | |
| skill = MIMESkill() | |
| assert skill is not None | |
| assert skill.name == "mime" | |
| def test_html_skill(self, config): | |
| from r_cli.skills.html_skill import HTMLSkill | |
| skill = HTMLSkill(config) | |
| assert skill is not None | |
| assert skill.name == "html" | |
| def test_xml_skill(self, config): | |
| from r_cli.skills.xml_skill import XMLSkill | |
| skill = XMLSkill(config) | |
| assert skill is not None | |
| assert skill.name == "xml" | |
| def test_jwt_skill(self, config): | |
| from r_cli.skills.jwt_skill import JWTSkill | |
| skill = JWTSkill(config) | |
| assert skill is not None | |
| assert skill.name == "jwt" | |
| # ============================================================================= | |
| # Skill Tools Tests | |
| # ============================================================================= | |
| class TestFormatSkillTools: | |
| """Test that format skills provide tools.""" | |
| def test_url_skill_tools(self, config): | |
| from r_cli.skills.url_skill import URLSkill | |
| skill = URLSkill(config) | |
| tools = skill.get_tools() | |
| assert len(tools) > 0 | |
| def test_ip_skill_tools(self, config): | |
| from r_cli.skills.ip_skill import IPSkill | |
| skill = IPSkill(config) | |
| tools = skill.get_tools() | |
| assert len(tools) > 0 | |
| def test_encoding_skill_tools(self, config): | |
| from r_cli.skills.encoding_skill import EncodingSkill | |
| skill = EncodingSkill(config) | |
| tools = skill.get_tools() | |
| assert len(tools) > 0 | |
| def test_color_skill_tools(self, config): | |
| from r_cli.skills.color_skill import ColorSkill | |
| skill = ColorSkill(config) | |
| tools = skill.get_tools() | |
| assert len(tools) > 0 | |
| def test_semver_skill_tools(self, config): | |
| from r_cli.skills.semver_skill import SemVerSkill | |
| skill = SemVerSkill(config) | |
| tools = skill.get_tools() | |
| assert len(tools) > 0 | |
| def test_mime_skill_tools(self): | |
| from r_cli.skills.mime_skill import MIMESkill | |
| skill = MIMESkill() | |
| tools = skill.get_tools() | |
| assert len(tools) > 0 | |
| def test_html_skill_tools(self, config): | |
| from r_cli.skills.html_skill import HTMLSkill | |
| skill = HTMLSkill(config) | |
| tools = skill.get_tools() | |
| assert len(tools) > 0 | |
| def test_xml_skill_tools(self, config): | |
| from r_cli.skills.xml_skill import XMLSkill | |
| skill = XMLSkill(config) | |
| tools = skill.get_tools() | |
| assert len(tools) > 0 | |
| def test_jwt_skill_tools(self, config): | |
| from r_cli.skills.jwt_skill import JWTSkill | |
| skill = JWTSkill(config) | |
| tools = skill.get_tools() | |
| assert len(tools) > 0 | |
| # ============================================================================= | |
| # Functional Tests - EncodingSkill | |
| # ============================================================================= | |
| class TestEncodingSkillFunctional: | |
| """Functional tests for EncodingSkill.""" | |
| def test_hex_encode(self, config): | |
| from r_cli.skills.encoding_skill import EncodingSkill | |
| skill = EncodingSkill(config) | |
| result = skill.hex_encode("hello") | |
| assert "68656c6c6f" in result.lower() | |
| def test_hex_decode(self, config): | |
| from r_cli.skills.encoding_skill import EncodingSkill | |
| skill = EncodingSkill(config) | |
| result = skill.hex_decode("68656c6c6f") | |
| assert "hello" in result | |
| # ============================================================================= | |
| # Functional Tests - XMLSkill | |
| # ============================================================================= | |
| class TestXMLSkillFunctional: | |
| """Functional tests for XMLSkill.""" | |
| def test_xml_to_json(self, config): | |
| from r_cli.skills.xml_skill import XMLSkill | |
| skill = XMLSkill(config) | |
| result = skill.xml_to_json("<root><item>value</item></root>") | |
| assert "{" in result | |
| assert "item" in result or "value" in result | |
| # ============================================================================= | |
| # More Import Tests for All Skills | |
| # ============================================================================= | |
| class TestAllSkillImports: | |
| """Test that all 74 skills can be imported.""" | |
| def test_pdf_skill(self): | |
| from r_cli.skills.pdf_skill import PDFSkill | |
| assert PDFSkill is not None | |
| def test_latex_skill(self): | |
| from r_cli.skills.latex_skill import LaTeXSkill | |
| assert LaTeXSkill is not None | |
| def test_markdown_skill(self): | |
| from r_cli.skills.markdown_skill import MarkdownSkill | |
| assert MarkdownSkill is not None | |
| def test_pdftools_skill(self): | |
| from r_cli.skills.pdftools_skill import PDFToolsSkill | |
| assert PDFToolsSkill is not None | |
| def test_template_skill(self): | |
| from r_cli.skills.template_skill import TemplateSkill | |
| assert TemplateSkill is not None | |
| def test_resume_skill(self): | |
| from r_cli.skills.resume_skill import ResumeSkill | |
| assert ResumeSkill is not None | |
| def test_changelog_skill(self): | |
| from r_cli.skills.changelog_skill import ChangelogSkill | |
| assert ChangelogSkill is not None | |
| def test_code_skill(self): | |
| from r_cli.skills.code_skill import CodeSkill | |
| assert CodeSkill is not None | |
| def test_sql_skill(self): | |
| from r_cli.skills.sql_skill import SQLSkill | |
| assert SQLSkill is not None | |
| def test_schema_skill(self): | |
| from r_cli.skills.schema_skill import SchemaSkill | |
| assert SchemaSkill is not None | |
| def test_rag_skill(self): | |
| from r_cli.skills.rag_skill import RAGSkill | |
| assert RAGSkill is not None | |
| def test_multiagent_skill(self): | |
| from r_cli.skills.multiagent_skill import MultiAgentSkill | |
| assert MultiAgentSkill is not None | |
| def test_translate_skill(self): | |
| from r_cli.skills.translate_skill import TranslateSkill | |
| assert TranslateSkill is not None | |
| def test_faker_skill(self): | |
| from r_cli.skills.faker_skill import FakerSkill | |
| assert FakerSkill is not None | |
| def test_ocr_skill(self): | |
| from r_cli.skills.ocr_skill import OCRSkill | |
| assert OCRSkill is not None | |
| def test_voice_skill(self): | |
| from r_cli.skills.voice_skill import VoiceSkill | |
| assert VoiceSkill is not None | |
| def test_imagegen_skill(self): | |
| from r_cli.skills.imagegen_skill import ImageGenSkill | |
| assert ImageGenSkill is not None | |
| def test_image_skill(self): | |
| from r_cli.skills.image_skill import ImageSkill | |
| assert ImageSkill is not None | |
| def test_video_skill(self): | |
| from r_cli.skills.video_skill import VideoSkill | |
| assert VideoSkill is not None | |
| def test_audio_skill(self): | |
| from r_cli.skills.audio_skill import AudioSkill | |
| assert AudioSkill is not None | |
| def test_screenshot_skill(self): | |
| from r_cli.skills.screenshot_skill import ScreenshotSkill | |
| assert ScreenshotSkill is not None | |
| def test_qr_skill(self): | |
| from r_cli.skills.qr_skill import QRSkill | |
| assert QRSkill is not None | |
| def test_barcode_skill(self): | |
| from r_cli.skills.barcode_skill import BarcodeSkill | |
| assert BarcodeSkill is not None | |
| def test_fs_skill(self): | |
| from r_cli.skills.fs_skill import FilesystemSkill | |
| assert FilesystemSkill is not None | |
| def test_clipboard_skill(self): | |
| from r_cli.skills.clipboard_skill import ClipboardSkill | |
| assert ClipboardSkill is not None | |
| def test_env_skill(self): | |
| from r_cli.skills.env_skill import EnvSkill | |
| assert EnvSkill is not None | |
| def test_calendar_skill(self): | |
| from r_cli.skills.calendar_skill import CalendarSkill | |
| assert CalendarSkill is not None | |
| def test_email_skill(self): | |
| from r_cli.skills.email_skill import EmailSkill | |
| assert EmailSkill is not None | |
| def test_ical_skill(self): | |
| from r_cli.skills.ical_skill import ICalSkill | |
| assert ICalSkill is not None | |
| def test_vcard_skill(self): | |
| from r_cli.skills.vcard_skill import VCardSkill | |
| assert VCardSkill is not None | |
| def test_docker_skill(self): | |
| from r_cli.skills.docker_skill import DockerSkill | |
| assert DockerSkill is not None | |
| def test_ssh_skill(self): | |
| from r_cli.skills.ssh_skill import SSHSkill | |
| assert SSHSkill is not None | |
| def test_http_skill(self): | |
| from r_cli.skills.http_skill import HTTPSkill | |
| assert HTTPSkill is not None | |
| def test_web_skill(self): | |
| from r_cli.skills.web_skill import WebSkill | |
| assert WebSkill is not None | |
| def test_network_skill(self): | |
| from r_cli.skills.network_skill import NetworkSkill | |
| assert NetworkSkill is not None | |
| def test_system_skill(self): | |
| from r_cli.skills.system_skill import SystemSkill | |
| assert SystemSkill is not None | |
| def test_metrics_skill(self): | |
| from r_cli.skills.metrics_skill import MetricsSkill | |
| assert MetricsSkill is not None | |
| def test_logs_skill(self): | |
| from r_cli.skills.logs_skill import LogsSkill | |
| assert LogsSkill is not None | |
| def test_benchmark_skill(self): | |
| from r_cli.skills.benchmark_skill import BenchmarkSkill | |
| assert BenchmarkSkill is not None | |
| def test_openapi_skill(self): | |
| from r_cli.skills.openapi_skill import OpenAPISkill | |
| assert OpenAPISkill is not None | |
| def test_cron_skill(self): | |
| from r_cli.skills.cron_skill import CronSkill | |
| assert CronSkill is not None | |
| def test_currency_skill(self): | |
| from r_cli.skills.currency_skill import CurrencySkill | |
| assert CurrencySkill is not None | |
| def test_rss_skill(self): | |
| from r_cli.skills.rss_skill import RSSSkill | |
| assert RSSSkill is not None | |
| def test_sitemap_skill(self): | |
| from r_cli.skills.sitemap_skill import SitemapSkill | |
| assert SitemapSkill is not None | |
| def test_manifest_skill(self): | |
| from r_cli.skills.manifest_skill import ManifestSkill | |
| assert ManifestSkill is not None | |
| def test_weather_skill(self): | |
| from r_cli.skills.weather_skill import WeatherSkill | |
| assert WeatherSkill is not None | |
| def test_hublab_skill(self): | |
| from r_cli.skills.hublab_skill import HubLabSkill | |
| assert HubLabSkill is not None | |
| def test_plugin_skill(self): | |
| from r_cli.skills.plugin_skill import PluginSkill | |
| assert PluginSkill is not None | |
Xet Storage Details
- Size:
- 13.9 kB
- Xet hash:
- dd8ceb26764735337400918c3c0e5a35f5c037e6333c8b99f11645b100d688c8
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.