Example #1
0
def test_identifier_dollar():
    assert identifier("Table$") == "Table$"
Example #2
0
def test_identifier_quoted_space():
    assert identifier("A Table") == '"A Table"'
Example #3
0
def test_identifier_quoted_double_quote():
    assert identifier('A " Table') == '"A "" Table"'
Example #4
0
def test_identifier_quoted_first_char():
    assert identifier(" Table") == '" Table"'
Example #5
0
def test_identifier_quoted_null():
    with pytest.raises(
            InterfaceError,
            match="identifier cannot contain the code zero character"):
        identifier("tabl\u0000e")
Example #6
0
def test_identifier_empty():
    with pytest.raises(InterfaceError,
                       match="identifier must be > 0 characters in length"):
        identifier("")
Example #7
0
def test_identifier_int():
    with pytest.raises(InterfaceError, match="identifier must be a str"):
        identifier(9)
Example #8
0
def test_identifier():
    val = "top_secret"
    assert identifier(val) == val