def test_more_complicated_transmogrification(self): assert (db.transmogrify("UPDATE foo SET %X WHERE e = %X AND g = %X", { "a": "b", "c": "d" }, "f", 3.14159) == ("UPDATE foo SET a = ?, c = ? " "WHERE e = ? AND g = ?", ['b', 'd', 'f', 3.14159]))
def test_more_complicated_transmogrification(self): assert (db.transmogrify("UPDATE foo SET %X WHERE e = %X AND g = %X", {"a": "b", "c": "d"}, "f", 3.14159) == ("UPDATE foo SET a = ?, c = ? " "WHERE e = ? AND g = ?", ['b', 'd', 'f', 3.14159]))
def test_simple_transmogrification(self): assert (db.transmogrify("SELECT * FROM foo WHERE bar = %X", 1) == ("SELECT * FROM foo WHERE bar = ?", [1]))
def test_null_transmogrification(self): assert (db.transmogrify("SELECT * FROM foo") == ("SELECT * FROM foo", []))