mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-23 21:59:14 +09:00
- 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>
25 lines
938 B
Python
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"
|