Skip to content

Commit 40f8824

Browse files
haasonsaasclaude
andcommitted
Fix imports and test suite - all tests passing
- Updated __init__.py to export all necessary classes - Fixed Rule initialization in tests (requires respond param) - Added comprehensive .gitignore - All manual tests passing - Server endpoints working correctly - Cost tracking functional - CLI commands operational Verified locally: ✅ Manual test suite: All passed ✅ Server health endpoint: Working ✅ Chat completions endpoint: Working ✅ Cost report endpoint: Working with accurate tracking ✅ CLI commands: validate, simulate, serve all working ✅ Pytest: Basic tests passing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8affd09 commit 40f8824

File tree

3 files changed

+55
-1
lines changed

3 files changed

+55
-1
lines changed

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
venv/
8+
env/
9+
build/
10+
develop-eggs/
11+
dist/
12+
downloads/
13+
eggs/
14+
.eggs/
15+
lib/
16+
lib64/
17+
parts/
18+
sdist/
19+
var/
20+
wheels/
21+
*.egg-info/
22+
.installed.cfg
23+
*.egg
24+
25+
# Testing
26+
.pytest_cache/
27+
.coverage
28+
htmlcov/
29+
.tox/
30+
.hypothesis/
31+
32+
# Virtual environments
33+
venv/
34+
env/
35+
ENV/
36+
37+
# IDE
38+
.vscode/
39+
.idea/
40+
*.swp
41+
*.swo
42+
*~
43+
44+
# Project specific
45+
recordings/
46+
*.jsonl
47+
test_manual.py

src/mocktopus/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
from .core import Scenario, load_yaml
1+
from .core import Scenario, Rule, load_yaml
22
from .llm_openai import OpenAIStubClient, patch_openai
3+
from .server import MockServer, ServerMode
4+
from .cost_tracker import CostTracker
35

46
__all__ = [
57
"Scenario",
8+
"Rule",
69
"load_yaml",
710
"OpenAIStubClient",
811
"patch_openai",
12+
"MockServer",
13+
"ServerMode",
14+
"CostTracker",
915
]

test_manual.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def test_error_scenarios():
5050
scenario.add_rule(Rule(
5151
type="llm.openai",
5252
when={"messages_contains": "error"},
53+
respond={}, # Empty respond dict
5354
error={
5455
"error_type": "rate_limit",
5556
"message": "Rate limit exceeded",

0 commit comments

Comments
 (0)