Exemplo n.º 1
0
def test_escape_None():
    types.escape(None) == "NULL"
Exemplo n.º 2
0
def test_escape_list():
    assert types.escape(("a", "b")) == "('a', 'b')"
Exemplo n.º 3
0
def test_escape_list_with_apostrophe():
    assert types.escape(("a'", "'b")) == "('a''', '''b')"
Exemplo n.º 4
0
def test_escape_string_with_apostrophe():
    text = "'Hello' \"World\""
    assert types.escape(text) == "'''Hello'' \"World\"'"
Exemplo n.º 5
0
def test_escape_unicode_with_apostrophe():
    text = u"'Hüllö' \"Wörldß\""
    assert types.escape(text) == u"'''Hüllö'' \"Wörldß\"'"
Exemplo n.º 6
0
def test_escape_simple_string():
    text = "Hello World"
    assert types.escape(text) == "'Hello World'"
Exemplo n.º 7
0
def test_escape_simple_unicode():
    text = u"Hello World"
    assert types.escape(text) == u"'Hello World'"
Exemplo n.º 8
0
def test_escape_None():
    types.escape(None) == "NULL"
Exemplo n.º 9
0
def test_escape_unsupported_type():
    with pytest.raises(InterfaceError):
        types.escape(lambda *args: args)
Exemplo n.º 10
0
def test_escape_list():
    assert types.escape(("a", "b")) == "('a', 'b')"
Exemplo n.º 11
0
def test_escape_list_with_apostrophe():
    assert types.escape(("a'", "'b")) == "('a''', '''b')"
Exemplo n.º 12
0
def test_escape_unicode_with_apostrophe():
    text = u"'Hüllö' \"Wörldß\""
    assert types.escape(text) == u"'''Hüllö'' \"Wörldß\"'"
Exemplo n.º 13
0
def test_escape_string_with_apostrophe():
    text = "'Hello' \"World\""
    assert types.escape(text) == "'''Hello'' \"World\"'"
Exemplo n.º 14
0
def test_escape_simple_unicode():
    text = u"Hello World"
    assert types.escape(text) == u"'Hello World'"
Exemplo n.º 15
0
def test_escape_simple_string():
    text = "Hello World"
    assert types.escape(text) == "'Hello World'"
Exemplo n.º 16
0
def test_escape_unsupported_type():
    with pytest.raises(InterfaceError):
        types.escape(lambda *args: args)