Files
ruflo/v2/examples/flask-api-sparc/tests/test_test_services.py
T
rUvandClaude Opus 4.5 1b6a1971f7 feat(v3): add comprehensive v3 implementation plans and swarm architecture
- Reorganize v3/ into implementation/ subfolders:
  - planning/, architecture/, migration/, integration/
  - security/, adrs/, research/, swarm-plans/

- Add 15-agent concurrent swarm implementation plans:
  - SWARM-OVERVIEW.md: Hierarchical mesh topology, 4 phases
  - AGENT-SPECIFICATIONS.md: 15 agent configs with capabilities
  - TDD-LONDON-SCHOOL-PLAN.md: Mock-first TDD methodology
  - BENCHMARK-OPTIMIZATION.md: Performance targets (2.49x-7.47x)
  - DEPLOYMENT-PLAN.md: Release strategy, CI/CD, rollback
  - GITHUB-ISSUE-TRACKING.md: Issue workflow with agent replies

- Update .claude/settings.json with proper hooks format
- Add bash aliases for claude --dangerously-skip-permissions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 15:40:51 +00:00

25 lines
938 B
Python

import pytest
from unittest.mock import Mock, patch
from src.services import UserService, ProductService
class TestUserService:
@pytest.fixture
def user_service(self):
return UserService()
def test_create_user_success(self, user_service):
"""Test successful user creation"""
user_data = {"username": "newuser", "email": "new@example.com"}
with patch('src.services.db') as mock_db:
user = user_service.create_user(user_data)
assert user.username == "newuser"
mock_db.session.add.assert_called_once()
def test_get_user_by_id(self, user_service):
"""Test retrieving user by ID"""
with patch('src.services.User.query') as mock_query:
mock_query.get.return_value = Mock(id=1, username="testuser")
user = user_service.get_user(1)
assert user.id == 1
assert user.username == "testuser"