Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 3
0
def test_camel(v, expected):
    assert phrases_case.camel(v) == expected