Commit 663b7e4
authored
test: improve coverage for models and toolset modules (76% → 87%) (#67)
* refactor(toolset): remove unused _matches_filter method
Remove the _matches_filter method from StackOneToolSet as it was
never called in the source code (only used in tests). This reduces
code complexity and improves test coverage percentage.
The existing _filter_by_provider and _filter_by_action methods
provide equivalent functionality and are actually used in fetch_tools.
* test: improve coverage for models and toolset modules
Add comprehensive tests for previously uncovered code paths:
models.py (78% -> 95%):
- validate_method unsupported HTTP method error
- ExecuteConfig validation
- Parameter location handling (PATH, QUERY, BODY)
- HTTP error handling (JSON and text response bodies)
- RequestError handling
- Non-dict response wrapping
- OpenAI conversion (enum, array, object, non-dict properties)
- LangChain conversion (number, integer, boolean types)
- Async _arun method
- Tools container iteration and account ID methods
toolset.py (52% -> 77%):
- _StackOneRpcTool execution (basic, JSON string, payloads)
- Header handling (Authorization stripping, None value skipping)
- Argument parsing edge cases
Overall coverage improved from 76% to 87%.1 parent 9d180ef commit 663b7e4
File tree
4 files changed
+736
-56
lines changed- stackone_ai
- tests
4 files changed
+736
-56
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | 256 | | |
285 | 257 | | |
286 | 258 | | |
| |||
0 commit comments