import pytest
from nomy_data_models.utils.string import to_snake_case
class TestString:
@pytest.mark.parametrize(
"input_text,expected_output",
[
("HelloWorld", "hello_world"),
("hello_world", "hello_world"),
("hello-world", "hello_world"),
("HELLO_WORLD", "hello_world"),
("helloWorld123", "hello_world123"),
("hello world", "hello_world"),
("Hello World", "hello_world"),
("HelloWorld!", "hello_world_"),
("", ""),
("A", "a"),
("123", "123"),
("_hello_", "_hello_"),
("snake_case", "snake_case"),
("camelCase", "camel_case"),
("PascalCase", "pascal_case"),
("SCREAMING_SNAKE_CASE", "screaming_snake_case"),
("kebab-case", "kebab_case"),
("Title Case", "title_case"),
("snake_Case_Mixed", "snake_case_mixed"),
("__double__underscore__", "__double__underscore__"),
],
)
def test_to_snake_case(self, input_text, expected_output):
result = to_snake_case(input_text)
assert (
result == expected_output
), f"Expected '{input_text}' to convert to '{expected_output}', got '{result}'"