From 25436a6f8f03d480eac19430d300ac6fb38f2bcd Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sat, 31 Jan 2026 08:31:01 +0000 Subject: [PATCH] Add tests package --- .tests/conftest.py | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .tests/conftest.py diff --git a/.tests/conftest.py b/.tests/conftest.py new file mode 100644 index 0000000..75f4647 --- /dev/null +++ b/.tests/conftest.py @@ -0,0 +1,67 @@ +"""Test configuration and fixtures for CLI Command Memory.""" + +import os +import tempfile +import pytest +from cli_memory.config import Config + + +@pytest.fixture +def temp_dir(): + """Provide a temporary directory.""" + with tempfile.TemporaryDirectory() as tmpdir: + yield tmpdir + + +@pytest.fixture +def config(): + """Provide a Config instance.""" + return Config() + + +@pytest.fixture +def sample_project_data(): + """Provide sample project data.""" + return { + "name": "test-project", + "path": "/tmp/test", + "git_remote": "https://github.com/user/test.git", + "tech_stack": ["python", "docker"], + } + + +@pytest.fixture +def sample_command_data(): + """Provide sample command data.""" + return { + "command": "git status", + "command_type": "git", + "exit_code": 0, + "duration_ms": 50, + "working_directory": "/home/user/project", + "tags": ["git", "status"], + } + + +@pytest.fixture +def sample_workflow_data(): + """Provide sample workflow data.""" + return { + "name": "Test Workflow", + "description": "A test workflow", + "commands": [ + {"command": "git status", "command_type": "git"}, + {"command": "git add .", "command_type": "git"}, + ], + } + + +@pytest.fixture +def env_override(): + """Provide environment variable override context.""" + original_env = os.environ.copy() + + yield + + os.environ.clear() + os.environ.update(original_env)