File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Tests
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ test :
7+ runs-on : ubuntu-latest
8+ strategy :
9+ matrix :
10+ python-version : [3.11, 3.12]
11+
12+ steps :
13+ - uses : actions/checkout@v3
14+ - name : Set up Python ${{ matrix.python-version }}
15+ uses : actions/setup-python@v4
16+ with :
17+ python-version : ${{ matrix.python-version }}
18+ - name : Install dependencies
19+ run : |
20+ pip install -r requirements.txt
21+ pip install pytest
22+ - name : Run tests
23+ run : pytest tests/ -v
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Example: Analyze Django repository
3+
4+ git clone https://github.com/django/django.git /tmp/django
5+ cd /tmp/django
6+
7+ python3 -m venv venv
8+ source venv/bin/activate
9+ pip install -r /path/to/devmemory/requirements.txt
10+
11+ python /path/to/devmemory/src/cli.py analyze --days 30
12+ python /path/to/devmemory/src/cli.py stats
13+ python /path/to/devmemory/src/cli.py export --output django_decisions.md
Original file line number Diff line number Diff line change 1+ import pytest
2+ from src .analyzer .decision_detector import DecisionPatternAnalyzer
3+ from datetime import datetime
4+
5+ def test_dependency_detection ():
6+ analyzer = DecisionPatternAnalyzer ()
7+ decision = analyzer .analyze_commit (
8+ commit_message = "Add Redis for caching" ,
9+ files_changed = ['requirements.txt' ],
10+ commit_hash = 'abc123' ,
11+ author = 'Test' ,
12+ date = datetime .now ()
13+ )
14+ assert decision is not None
15+ assert decision .type == 'dependency_added'
16+ assert decision .confidence > 0.5
17+
18+ def test_refactor_detection ():
19+ analyzer = DecisionPatternAnalyzer ()
20+ decision = analyzer .analyze_commit (
21+ commit_message = "Refactor authentication system" ,
22+ files_changed = ['auth.py' ],
23+ commit_hash = 'def456' ,
24+ author = 'Test' ,
25+ date = datetime .now ()
26+ )
27+ assert decision is not None
28+ assert decision .type == 'architecture_change'
You can’t perform that action at this time.
0 commit comments