Skip to content

Conversation

@Jeong-Ryeol
Copy link
Contributor

@Jeong-Ryeol Jeong-Ryeol commented Dec 1, 2025

Addresses #158

Added unit tests for the argument_parser module.

Noticed there weren't any tests yet, so I started with argument_parser since it has clean, testable functions.

What's included:

  • Basic test setup (conftest.py with fixtures)
  • Tests for bool/list/dict conversion functions
  • Tests for type annotation handling (Optional, Union types)
  • Tests for the main convert_arguments function

Let me know if you'd like any changes!

Add comprehensive test suite for the argument_parser module including:
- Tests for _convert_to_bool with truthy/falsy values
- Tests for _convert_to_list with JSON and comma-separated inputs
- Tests for _convert_to_dict with valid/invalid JSON
- Tests for convert_string_to_type with various type annotations
- Tests for convert_arguments with typed functions
- Tests for ArgumentConversionError exception class

This establishes the foundation for the project's test infrastructure
with pytest configuration already in place.
@0xallam
Copy link
Member

0xallam commented Dec 3, 2025

LGTM! @Jeong-Ryeol
I think we need to add even more unit tests now, especially to the most critical parts of the agent. I will add that as a separate issue as well. Thanks!

@0xallam 0xallam merged commit 35dd9d0 into usestrix:main Dec 3, 2025
Jeong-Ryeol added a commit to Jeong-Ryeol/strix that referenced this pull request Dec 5, 2025
Following up on @0xallam's comment on usestrix#157:
> "I think we need to add even more unit tests now, especially to the most critical parts of the agent."

This PR adds tests for `llm/utils.py` - the core LLM response parsing logic.

Addresses usestrix#158

What's included:
- TestParseToolInvocations: XML tool invocation parsing (8 tests)
- TestFixStopword: Incomplete function tag handling (4 tests)
- TestFormatToolCall: Tool call XML formatting (4 tests)
- TestCleanContent: Content cleaning and XML removal (6 tests)
- TestTruncateToFirstFunction: First function truncation (4 tests)

Total: 26 tests, all passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants