test: add initial unit tests for argument_parser module

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.
This commit is contained in:
Jeong-Ryeol
2025-12-01 12:59:20 +09:00
committed by Ahmed Allam
parent 919cb5e248
commit 65c3383ecc
3 changed files with 299 additions and 0 deletions

31
tests/conftest.py Normal file
View File

@@ -0,0 +1,31 @@
"""Pytest configuration and shared fixtures for Strix tests."""
import pytest
@pytest.fixture
def sample_function_with_types():
"""Create a sample function with type annotations for testing argument conversion."""
def func(
name: str,
count: int,
enabled: bool,
ratio: float,
items: list,
config: dict,
optional: str | None = None,
) -> None:
pass
return func
@pytest.fixture
def sample_function_no_annotations():
"""Create a sample function without type annotations."""
def func(arg1, arg2, arg3):
pass
return func