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:
31
tests/conftest.py
Normal file
31
tests/conftest.py
Normal 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
|
||||
Reference in New Issue
Block a user