arcade-mcp/arcade/tests/core/utils/test_casing.py
Nate Barbettini 739cc957f1
Fix CI: config errors, Python 3.11 union type errors (#45)
Fixes 2 issues that were causing CI to fail:
- Loading `config` in `eval.py` breaks because no API key can be found
in CI
- Python 3.11+ changed `Union` to `UnionType`
2024-09-19 12:07:28 -07:00

26 lines
717 B
Python

import pytest
from arcade.core.utils import pascal_to_snake_case, snake_to_pascal_case
@pytest.mark.parametrize(
"input_str, expected",
[
("SnakeCase", "snake_case"),
("VeryLongSnake456", "very_long_snake456"),
],
)
def test_pascal_to_snake_case(input_str: str, expected: str):
assert pascal_to_snake_case(input_str) == expected
@pytest.mark.parametrize(
"input_str, expected",
[
("snake_case", "SnakeCase"),
("very_long_snake_456", "VeryLongSnake456"),
("camelCase", "Camelcase"), # camelCase isn't explicitly supported
],
)
def test_snake_to_pascal_case(input_str: str, expected: str):
assert snake_to_pascal_case(input_str) == expected