Initial upload: Git AI Documentation Generator v0.1.0
Some checks failed
CI / test (push) Has been cancelled
Some checks failed
CI / test (push) Has been cancelled
This commit is contained in:
67
tests/conftest.py
Normal file
67
tests/conftest.py
Normal file
@@ -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,
|
||||
},
|
||||
]
|
||||
Reference in New Issue
Block a user