agentassert 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentassert-0.1.0/.gitignore +126 -0
- agentassert-0.1.0/CONTRIBUTING.md +210 -0
- agentassert-0.1.0/LICENSE +34 -0
- agentassert-0.1.0/PKG-INFO +395 -0
- agentassert-0.1.0/README.md +348 -0
- agentassert-0.1.0/agentunit/__init__.py +102 -0
- agentassert-0.1.0/agentunit/_version.py +4 -0
- agentassert-0.1.0/agentunit/adapters/__init__.py +6 -0
- agentassert-0.1.0/agentunit/adapters/base.py +33 -0
- agentassert-0.1.0/agentunit/adapters/generic.py +105 -0
- agentassert-0.1.0/agentunit/assertions/__init__.py +56 -0
- agentassert-0.1.0/agentunit/assertions/behavior.py +206 -0
- agentassert-0.1.0/agentunit/assertions/fluent.py +210 -0
- agentassert-0.1.0/agentunit/assertions/matchers.py +365 -0
- agentassert-0.1.0/agentunit/cli/__init__.py +5 -0
- agentassert-0.1.0/agentunit/cli/commands/__init__.py +5 -0
- agentassert-0.1.0/agentunit/cli/commands/run.py +125 -0
- agentassert-0.1.0/agentunit/cli/main.py +37 -0
- agentassert-0.1.0/agentunit/core/__init__.py +16 -0
- agentassert-0.1.0/agentunit/core/collector.py +242 -0
- agentassert-0.1.0/agentunit/core/item.py +71 -0
- agentassert-0.1.0/agentunit/core/outcome.py +121 -0
- agentassert-0.1.0/agentunit/core/runner.py +179 -0
- agentassert-0.1.0/agentunit/core/session.py +135 -0
- agentassert-0.1.0/agentunit/decorators.py +69 -0
- agentassert-0.1.0/agentunit/fixtures.py +97 -0
- agentassert-0.1.0/agentunit/mocks/__init__.py +10 -0
- agentassert-0.1.0/agentunit/mocks/tool_mock.py +323 -0
- agentassert-0.1.0/agentunit/reporters/__init__.py +5 -0
- agentassert-0.1.0/agentunit/reporters/terminal.py +195 -0
- agentassert-0.1.0/agentunit/trace/__init__.py +17 -0
- agentassert-0.1.0/agentunit/trace/event.py +105 -0
- agentassert-0.1.0/agentunit/trace/span.py +71 -0
- agentassert-0.1.0/agentunit/trace/tracer.py +308 -0
- agentassert-0.1.0/agentunit/trace/tree.py +153 -0
- agentassert-0.1.0/pyproject.toml +91 -0
- agentassert-0.1.0/tests/test_sample.py +180 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Internal documentation (not for public distribution)
|
|
2
|
+
AGENTUNIT_SPEC.md
|
|
3
|
+
|
|
4
|
+
# Byte-compiled / optimized / DLL files
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*$py.class
|
|
8
|
+
|
|
9
|
+
# C extensions
|
|
10
|
+
*.so
|
|
11
|
+
|
|
12
|
+
# Distribution / packaging
|
|
13
|
+
.Python
|
|
14
|
+
build/
|
|
15
|
+
develop-eggs/
|
|
16
|
+
dist/
|
|
17
|
+
downloads/
|
|
18
|
+
eggs/
|
|
19
|
+
.eggs/
|
|
20
|
+
lib/
|
|
21
|
+
lib64/
|
|
22
|
+
parts/
|
|
23
|
+
sdist/
|
|
24
|
+
var/
|
|
25
|
+
wheels/
|
|
26
|
+
share/python-wheels/
|
|
27
|
+
*.egg-info/
|
|
28
|
+
.installed.cfg
|
|
29
|
+
*.egg
|
|
30
|
+
MANIFEST
|
|
31
|
+
|
|
32
|
+
# PyInstaller
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
pytest_cache/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Environments
|
|
60
|
+
.env
|
|
61
|
+
.venv
|
|
62
|
+
env/
|
|
63
|
+
venv/
|
|
64
|
+
ENV/
|
|
65
|
+
env.bak/
|
|
66
|
+
venv.bak/
|
|
67
|
+
.python-version
|
|
68
|
+
|
|
69
|
+
# Spyder project settings
|
|
70
|
+
.spyderproject
|
|
71
|
+
.spyproject
|
|
72
|
+
|
|
73
|
+
# Rope project settings
|
|
74
|
+
.ropeproject
|
|
75
|
+
|
|
76
|
+
# mkdocs documentation
|
|
77
|
+
/site
|
|
78
|
+
|
|
79
|
+
# mypy
|
|
80
|
+
.mypy_cache/
|
|
81
|
+
.dmypy.json
|
|
82
|
+
dmypy.json
|
|
83
|
+
|
|
84
|
+
# Pyre type checker
|
|
85
|
+
.pyre/
|
|
86
|
+
|
|
87
|
+
# pytype static type analyzer
|
|
88
|
+
.pytype/
|
|
89
|
+
|
|
90
|
+
# Cython debug symbols
|
|
91
|
+
cython_debug/
|
|
92
|
+
|
|
93
|
+
# IDE
|
|
94
|
+
.idea/
|
|
95
|
+
.vscode/
|
|
96
|
+
*.swp
|
|
97
|
+
*.swo
|
|
98
|
+
*~
|
|
99
|
+
.DS_Store
|
|
100
|
+
|
|
101
|
+
# Jupyter Notebook
|
|
102
|
+
.ipynb_checkpoints/
|
|
103
|
+
|
|
104
|
+
# Local development
|
|
105
|
+
.local/
|
|
106
|
+
*.local
|
|
107
|
+
local_settings.py
|
|
108
|
+
|
|
109
|
+
# Secrets
|
|
110
|
+
.secrets/
|
|
111
|
+
*.pem
|
|
112
|
+
*.key
|
|
113
|
+
|
|
114
|
+
# Logs
|
|
115
|
+
logs/
|
|
116
|
+
*.log
|
|
117
|
+
|
|
118
|
+
# Database
|
|
119
|
+
*.db
|
|
120
|
+
*.sqlite3
|
|
121
|
+
|
|
122
|
+
# Temporary files
|
|
123
|
+
tmp/
|
|
124
|
+
temp/
|
|
125
|
+
*.tmp
|
|
126
|
+
*.bak
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Contributing to AgentUnit
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to AgentUnit.
|
|
4
|
+
|
|
5
|
+
This document outlines the guidelines for contributing to the project. Please read through before submitting your first contribution.
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Code of Conduct](#code-of-conduct)
|
|
10
|
+
- [How Can I Contribute?](#how-can-i-contribute)
|
|
11
|
+
- [Development Setup](#development-setup)
|
|
12
|
+
- [Pull Request Process](#pull-request-process)
|
|
13
|
+
- [Style Guidelines](#style-guidelines)
|
|
14
|
+
- [Attribution](#attribution)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Code of Conduct
|
|
19
|
+
|
|
20
|
+
By participating in this project, you agree to maintain a respectful and inclusive environment. We expect all contributors to:
|
|
21
|
+
|
|
22
|
+
- Use welcoming and inclusive language
|
|
23
|
+
- Be respectful of differing viewpoints and experiences
|
|
24
|
+
- Gracefully accept constructive criticism
|
|
25
|
+
- Focus on what is best for the community
|
|
26
|
+
- Show empathy towards other community members
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## How Can I Contribute?
|
|
31
|
+
|
|
32
|
+
### Reporting Bugs
|
|
33
|
+
|
|
34
|
+
Before creating a bug report, please check existing issues to avoid duplicates.
|
|
35
|
+
|
|
36
|
+
When reporting bugs, include:
|
|
37
|
+
|
|
38
|
+
1. **Clear title** describing the issue
|
|
39
|
+
2. **Steps to reproduce** the behavior
|
|
40
|
+
3. **Expected behavior** — what you expected to happen
|
|
41
|
+
4. **Actual behavior** — what actually happened
|
|
42
|
+
5. **Environment details** — Python version, OS, AgentUnit version
|
|
43
|
+
6. **Code samples** — minimal reproducible example if possible
|
|
44
|
+
|
|
45
|
+
### Suggesting Features
|
|
46
|
+
|
|
47
|
+
We love feature suggestions! Please include:
|
|
48
|
+
|
|
49
|
+
1. **Clear description** of the feature
|
|
50
|
+
2. **Use case** — why is this feature needed?
|
|
51
|
+
3. **Proposed implementation** (optional)
|
|
52
|
+
4. **Alternatives considered** (optional)
|
|
53
|
+
|
|
54
|
+
### Improving Documentation
|
|
55
|
+
|
|
56
|
+
Documentation improvements are always welcome:
|
|
57
|
+
|
|
58
|
+
- Fix typos or unclear wording
|
|
59
|
+
- Add examples and tutorials
|
|
60
|
+
- Improve API documentation
|
|
61
|
+
- Translate documentation
|
|
62
|
+
|
|
63
|
+
### Submitting Code
|
|
64
|
+
|
|
65
|
+
1. Fork the repository
|
|
66
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
67
|
+
3. Make your changes
|
|
68
|
+
4. Write or update tests
|
|
69
|
+
5. Run the test suite
|
|
70
|
+
6. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
71
|
+
7. Push to your fork (`git push origin feature/amazing-feature`)
|
|
72
|
+
8. Open a Pull Request
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Development Setup
|
|
77
|
+
|
|
78
|
+
### Prerequisites
|
|
79
|
+
|
|
80
|
+
- Python 3.10 or higher
|
|
81
|
+
- pip or uv package manager
|
|
82
|
+
- Git
|
|
83
|
+
|
|
84
|
+
### Setup Steps
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Clone your fork
|
|
88
|
+
git clone https://github.com/YOUR_USERNAME/agentunit.git
|
|
89
|
+
cd agentunit
|
|
90
|
+
|
|
91
|
+
# Create virtual environment
|
|
92
|
+
python -m venv venv
|
|
93
|
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
94
|
+
|
|
95
|
+
# Install in development mode with dev dependencies
|
|
96
|
+
pip install -e ".[dev]"
|
|
97
|
+
|
|
98
|
+
# Run tests to verify setup
|
|
99
|
+
agentunit run tests/
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Running Tests
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Run all tests
|
|
106
|
+
agentunit run tests/
|
|
107
|
+
|
|
108
|
+
# Run with verbose output
|
|
109
|
+
agentunit run tests/ -v
|
|
110
|
+
|
|
111
|
+
# Run specific test file
|
|
112
|
+
agentunit run tests/test_sample.py
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Code Quality
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Format code
|
|
119
|
+
ruff format .
|
|
120
|
+
|
|
121
|
+
# Lint code
|
|
122
|
+
ruff check .
|
|
123
|
+
|
|
124
|
+
# Type checking
|
|
125
|
+
mypy agentunit/
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Pull Request Process
|
|
131
|
+
|
|
132
|
+
1. **Update documentation** if you're changing functionality
|
|
133
|
+
2. **Add tests** for new features or bug fixes
|
|
134
|
+
3. **Ensure all tests pass** before submitting
|
|
135
|
+
4. **Follow the style guidelines** below
|
|
136
|
+
5. **Write clear commit messages**
|
|
137
|
+
6. **Link related issues** in your PR description
|
|
138
|
+
|
|
139
|
+
### PR Title Format
|
|
140
|
+
|
|
141
|
+
Use clear, descriptive titles:
|
|
142
|
+
|
|
143
|
+
- `feat: Add support for async agents`
|
|
144
|
+
- `fix: Handle empty tool responses correctly`
|
|
145
|
+
- `docs: Improve getting started guide`
|
|
146
|
+
- `test: Add tests for matcher edge cases`
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Style Guidelines
|
|
151
|
+
|
|
152
|
+
### Python Code Style
|
|
153
|
+
|
|
154
|
+
- Follow [PEP 8](https://pep8.org/)
|
|
155
|
+
- Use type hints for all public functions
|
|
156
|
+
- Maximum line length: 100 characters
|
|
157
|
+
- Use docstrings for all public modules, classes, and functions
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
def my_function(param1: str, param2: int) -> bool:
|
|
161
|
+
"""
|
|
162
|
+
Brief description of the function.
|
|
163
|
+
|
|
164
|
+
Args:
|
|
165
|
+
param1: Description of param1.
|
|
166
|
+
param2: Description of param2.
|
|
167
|
+
|
|
168
|
+
Returns:
|
|
169
|
+
Description of return value.
|
|
170
|
+
|
|
171
|
+
Raises:
|
|
172
|
+
ValueError: When param2 is negative.
|
|
173
|
+
"""
|
|
174
|
+
if param2 < 0:
|
|
175
|
+
raise ValueError("param2 must be non-negative")
|
|
176
|
+
return len(param1) > param2
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Commit Messages
|
|
180
|
+
|
|
181
|
+
- Use present tense ("Add feature" not "Added feature")
|
|
182
|
+
- Use imperative mood ("Move cursor to..." not "Moves cursor to...")
|
|
183
|
+
- Keep the first line under 72 characters
|
|
184
|
+
- Reference issues and PRs in the body when relevant
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Attribution
|
|
189
|
+
|
|
190
|
+
### Contributor Recognition
|
|
191
|
+
|
|
192
|
+
All contributors will be recognized in:
|
|
193
|
+
|
|
194
|
+
- The project's contributors list
|
|
195
|
+
- Release notes for significant contributions
|
|
196
|
+
- Special acknowledgments for major features
|
|
197
|
+
|
|
198
|
+
### License Agreement
|
|
199
|
+
|
|
200
|
+
By contributing to AgentUnit, you agree that your contributions will be licensed under the MIT License. You also confirm that you have the right to submit the contribution.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Questions?
|
|
205
|
+
|
|
206
|
+
If you have questions about contributing, feel free to open a Discussion on GitHub or reach out to the maintainers.
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
*Thank you for helping improve AgentUnit.*
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kaushik Dhola
|
|
4
|
+
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
ATTRIBUTION NOTICE:
|
|
28
|
+
|
|
29
|
+
When using AgentUnit in your projects, please provide appropriate credit by:
|
|
30
|
+
1. Retaining this license file in any distribution
|
|
31
|
+
2. Acknowledging AgentUnit in your project documentation
|
|
32
|
+
3. Not misrepresenting the origin of this software
|
|
33
|
+
|
|
34
|
+
For commercial support or enterprise licensing inquiries, please contact the author.
|