From 218f7a6e9928fb9cc6f22b937b18c466d5788028 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Sun, 1 Feb 2026 19:31:08 +0000 Subject: [PATCH] Initial upload: Git AI Documentation Generator v0.1.0 --- 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..9c7d3c2 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,67 @@ +"""Test configuration and fixtures.""" + +import os +import tempfile +from pathlib import Path + +import pytest + +os.chdir("/app") + + +@pytest.fixture +def temp_git_repo(): + """Create a temporary git repository for testing.""" + with tempfile.TemporaryDirectory() as tmpdir: + os.chdir(tmpdir) + os.system("git init --quiet") + os.system("git config user.email 'test@example.com'") + os.system("git config user.name 'Test User'") + yield Path(tmpdir) + os.chdir("/app") + + +@pytest.fixture +def sample_diff(): + """Sample git diff for testing.""" + return """diff --git a/src/main.py b/src/main.py +index 1234567..89abcdef 100644 +--- a/src/main.py ++++ b/src/main.py +@@ -1,3 +1,5 @@ ++def hello(): ++ print("Hello, World!") + def main(): + print("Hello") +""" + + +@pytest.fixture +def sample_commits(): + """Sample commit history for testing.""" + return [ + { + "sha": "abc1234", + "message": "feat(auth): add user authentication", + "author": "John Doe", + "date": "2024-01-15T10:30:00", + "type": "feat", + "scope": "auth", + }, + { + "sha": "def5678", + "message": "fix(api): resolve endpoint timeout", + "author": "Jane Smith", + "date": "2024-01-14T15:45:00", + "type": "fix", + "scope": "api", + }, + { + "sha": "ghi9012", + "message": "docs: update README", + "author": "Bob Wilson", + "date": "2024-01-13T09:00:00", + "type": "docs", + "scope": None, + }, + ]