def test_lowercase_with_underscores_conversion(self): convention = LowerCaseWithUnderscores() assert "punctuation" == convention.convert("Punctuation.?") assert "string_with_spaces" == convention.convert("String with spaces") assert "camel_case" == convention.convert("CamelCase") assert "numeric_1" == convention.convert("numeric 1") assert "alphanumeric_b4b4" == convention.convert("alphanumeric b4b4") assert "space_at_start" == convention.convert(" space at start") assert "spaces_at_end" == convention.convert("spaces At_end ") assert "idempotent_case" == convention.convert("idempotent_case")
def test_lowercase_with_underscores_test(self): convention = LowerCaseWithUnderscores() assert convention.formatted("lower_case") assert convention.formatted("ab_c___") assert convention.formatted("a___b") assert not convention.formatted("123_abc")