示例#1
0
def normalized_string(phrase: str) -> str:
    """ Normalize a string to flatcase (to match `cli name`).

    Args:
        phrase: Phrase to normalize.

    Returns:
        str: Normalized phrase.

    Examples:
        >>> normalized_string("TestWord")
        "testword"
        >>> normalized_string("hello_world")
        "helloworld"
    """
    return phrases_case.camel(phrase).replace("'", "").lower()
示例#2
0
def normalized_string(phrase: str) -> str:
    """ Normalize columns or Grid to connected word in lower-case.

    Args:
        phrase: Phrase to normalize.

    Returns:
        str: Normalized phrase.

    Examples:
        >>> normalized_string("TestWord")
        "testword"
        >>> normalized_string("hello_world")
        "hello_world"
    """
    return phrases_case.camel(phrase).replace("'", "").lower()
def test_camel(v, expected):
    assert phrases_case.camel(v) == expected