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