Example #1
0
File: test_db.py Project: palbee/db
 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]))
Example #2
0
 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]))
Example #3
0
 def test_simple_transmogrification(self):
     assert (db.transmogrify("SELECT * FROM foo WHERE bar = %X", 1) ==
             ("SELECT * FROM foo WHERE bar = ?", [1]))
Example #4
0
 def test_null_transmogrification(self):
     assert (db.transmogrify("SELECT * FROM foo") ==
             ("SELECT * FROM foo", []))
Example #5
0
File: test_db.py Project: palbee/db
 def test_simple_transmogrification(self):
     assert (db.transmogrify("SELECT * FROM foo WHERE bar = %X",
                             1) == ("SELECT * FROM foo WHERE bar = ?", [1]))
Example #6
0
File: test_db.py Project: palbee/db
 def test_null_transmogrification(self):
     assert (db.transmogrify("SELECT * FROM foo") == ("SELECT * FROM foo",
                                                      []))