def test_escape_None(): types.escape(None) == "NULL"
def test_escape_list(): assert types.escape(("a", "b")) == "('a', 'b')"
def test_escape_list_with_apostrophe(): assert types.escape(("a'", "'b")) == "('a''', '''b')"
def test_escape_string_with_apostrophe(): text = "'Hello' \"World\"" assert types.escape(text) == "'''Hello'' \"World\"'"
def test_escape_unicode_with_apostrophe(): text = u"'Hüllö' \"Wörldß\"" assert types.escape(text) == u"'''Hüllö'' \"Wörldß\"'"
def test_escape_simple_string(): text = "Hello World" assert types.escape(text) == "'Hello World'"
def test_escape_simple_unicode(): text = u"Hello World" assert types.escape(text) == u"'Hello World'"
def test_escape_unsupported_type(): with pytest.raises(InterfaceError): types.escape(lambda *args: args)