Skip to content

Commit 1e61923

Browse files
committed
test: add unit tests for snakecase
1 parent becd5d7 commit 1e61923

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import pytest
2+
3+
from dagster._utils import snakecase
4+
5+
6+
@pytest.mark.parametrize(
7+
"value, expected",
8+
[
9+
("MyClassName", "my_class_name"),
10+
("already_snake", "already_snake"),
11+
("with-dashes", "with_dashes"),
12+
("with spaces", "with_spaces"),
13+
("foo123Bar", "foo123_bar"),
14+
# Each capital in a run gets its own underscore boundary.
15+
("HTTPServer", "h_t_t_p_server"),
16+
],
17+
)
18+
def test_snakecase(value, expected):
19+
assert snakecase(value) == expected

0 commit comments

Comments
 (0)