|
19 | 19 | ("test_day_delta", "day_delta", True), |
20 | 20 | ("test_format_datetime", "format_datetime", True), |
21 | 21 | ("test_duration", "duration", True), |
| 22 | + ("test_camel_case_to_snake_case", "camel_case_to_snake_case", True), |
22 | 23 | ("test_not_a_macro", "thisisnotavalidmacro", False), |
23 | 24 | ], |
24 | 25 | ) |
@@ -249,3 +250,28 @@ def test_sanitize_url(test_name, input_value, expected_output): |
249 | 250 | sanitize_url = macros["sanitize_url"] |
250 | 251 | actual_output = sanitize_url(input_value) |
251 | 252 | assert actual_output == expected_output |
| 253 | + |
| 254 | + |
| 255 | +@pytest.mark.parametrize( |
| 256 | + "value, expected_value", |
| 257 | + [ |
| 258 | + ( |
| 259 | + "CamelCase", |
| 260 | + "camel_case", |
| 261 | + ), |
| 262 | + ( |
| 263 | + "snake_case", |
| 264 | + "snake_case", |
| 265 | + ), |
| 266 | + ( |
| 267 | + "CamelCasesnake_case", |
| 268 | + "camel_casesnake_case", |
| 269 | + ), |
| 270 | + ( |
| 271 | + "CamelCase_snake_case", |
| 272 | + "camel_case_snake_case", |
| 273 | + ), |
| 274 | + ], |
| 275 | +) |
| 276 | +def test_camel_case_to_snake_case(value, expected_value): |
| 277 | + assert macros["camel_case_to_snake_case"](value) == expected_value |
0 commit comments