From 3c0abaf61b685a8152616543a3a6eb55ee42ea23 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sat, 31 Jan 2026 05:31:20 +0000 Subject: [PATCH] Initial upload: shell-speak CLI tool with natural language to shell command conversion --- tests/conftest.py | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 tests/conftest.py diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..00c9e47 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,78 @@ +"""Pytest configuration for shell-speak tests.""" + +import os +import sys +import tempfile +from pathlib import Path + +import pytest + +sys.path.insert(0, str(Path(__file__).parent.parent)) + +os.environ["SHELL_SPEAK_DATA_DIR"] = tempfile.mkdtemp() +os.environ["SHELL_SPEAK_HISTORY_FILE"] = os.path.join(tempfile.mkdtemp(), "history.json") +os.environ["SHELL_SPEAK_CORRECTIONS_FILE"] = os.path.join(tempfile.mkdtemp(), "corrections.json") + + +@pytest.fixture +def sample_docker_yaml(): + """Sample docker command library for testing.""" + return """ +version: "1.0" +description: Docker test patterns + +patterns: + - name: list_containers + description: List running containers + patterns: + - list running containers + - show running containers + template: docker ps + explanation: Lists all running containers. + + - name: run_container + description: Run a new container + patterns: + - run a container + - start a new container + template: docker run -d --name {name} {image} + explanation: Starts a new container. +""" + + +@pytest.fixture +def sample_git_yaml(): + """Sample git command library for testing.""" + return """ +version: "1.0" +description: Git test patterns + +patterns: + - name: git_status + description: Show working tree status + patterns: + - git status + - check status + template: git status + explanation: Shows the current status. + + - name: git_commit + description: Commit changes + patterns: + - commit changes + - make commit + template: git commit -m "{message}" + explanation: Records changes with a message. +""" + + +@pytest.fixture +def sample_corrections_json(): + """Sample corrections JSON for testing.""" + return { + "version": "1.0", + "corrections": { + "custom:my custom query": "echo custom command", + "docker:show running containers": "docker ps -a", + } + }