示例#1
0
 def test_too_many_args(self):
     db = Fake("db").expects("execute").with_args(bind={'one':1})
     db.execute("select foozilate()", bind={'one':1}) # unexpected statement arg
示例#2
0
 def test_contains_str(self):
     db = Fake("db").expects("execute").with_args(arg.contains("table foo"))
     db.execute("select into table foo;")
     db.execute("select * from table foo where bar = 1")
     fudge.verify()
示例#3
0
 def test_contains_fail(self):
     db = Fake("db").expects("execute").with_args(arg.contains("table foo"))
     db.execute("select into table notyourmama;")
     fudge.verify()
示例#4
0
 def test_endswith_ok(self):
     db = Fake("db").expects("execute").with_args(arg.endswith("values (1,2,3,4)"))
     db.execute("insert into foo values (1,2,3,4)")
示例#5
0
 def test_endswith_ok_uni(self):
     db = Fake("db").expects("execute").with_args(arg.endswith(u"Ivan Krsti\u0107"))
     db.execute(u"select Ivan Krsti\u0107")
示例#6
0
 def test_startswith_ok_uni(self):
     db = Fake("db").expects("execute").with_args(arg.startswith(u"Ivan_Krsti\u0107"))
     db.execute(u"Ivan_Krsti\u0107(); foo();")
示例#7
0
 def test_any_value(self):
     db = Fake("db").expects("execute").with_args(arg.any())
     db.execute("delete from foo where 1")
示例#8
0
 def test_contains_fail(self):
     db = Fake("db").expects("execute").with_args(arg.contains("table foo"))
     db.execute("select into table notyourmama;")
     fudge.verify()
示例#9
0
 def test_startswith_fail(self):
     db = Fake("db").expects("execute").with_args(arg.startswith("insert into"))
     db.execute("select from")
示例#10
0
 def test_endswith_ok_uni(self):
     db = Fake("db").expects("execute").with_args(arg.endswith("Ivan Krsti\u0107"))
     db.execute("select Ivan Krsti\u0107")
示例#11
0
 def test_contains_str(self):
     db = Fake("db").expects("execute").with_args(arg.contains("table foo"))
     db.execute("select into table foo;")
     db.execute("select * from table foo where bar = 1")
     fudge.verify()
示例#12
0
 def test_endswith_ok(self):
     db = Fake("db").expects("execute").with_args(arg.endswith("values (1,2,3,4)"))
     db.execute("insert into foo values (1,2,3,4)")
示例#13
0
 def test_any_value(self):
     db = Fake("db").expects("execute").with_args(arg.any())
     db.execute("delete from foo where 1")
示例#14
0
 def test_startswith_ok_uni(self):
     db = Fake("db").expects("execute").with_args(arg.startswith("Ivan_Krsti\u0107"))
     db.execute("Ivan_Krsti\u0107(); foo();")
示例#15
0
 def test_startswith_fail(self):
     db = Fake("db").expects("execute").with_args(arg.startswith("insert into"))
     db.execute("select from")
示例#16
0
 def test_too_many_args(self):
     db = Fake("db").expects("execute").with_args(bind={'one': 1})
     db.execute("select foozilate()", bind={'one':
                                            1})  # unexpected statement arg