本文整理汇总了Python中fudge.Fake.execute方法的典型用法代码示例。如果您正苦于以下问题:Python Fake.execute方法的具体用法?Python Fake.execute怎么用?Python Fake.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fudge.Fake
的用法示例。
在下文中一共展示了Fake.execute方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_too_many_args
# 需要导入模块: from fudge import Fake [as 别名]
# 或者: from fudge.Fake import execute [as 别名]
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: test_contains_str
# 需要导入模块: from fudge import Fake [as 别名]
# 或者: from fudge.Fake import execute [as 别名]
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: test_contains_fail
# 需要导入模块: from fudge import Fake [as 别名]
# 或者: from fudge.Fake import execute [as 别名]
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: test_endswith_ok_uni
# 需要导入模块: from fudge import Fake [as 别名]
# 或者: from fudge.Fake import execute [as 别名]
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")
示例5: test_endswith_ok
# 需要导入模块: from fudge import Fake [as 别名]
# 或者: from fudge.Fake import execute [as 别名]
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)")
示例6: test_any_value
# 需要导入模块: from fudge import Fake [as 别名]
# 或者: from fudge.Fake import execute [as 别名]
def test_any_value(self):
db = Fake("db").expects("execute").with_args(arg.any())
db.execute("delete from foo where 1")
示例7: test_startswith_ok_uni
# 需要导入模块: from fudge import Fake [as 别名]
# 或者: from fudge.Fake import execute [as 别名]
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();")
示例8: test_startswith_fail
# 需要导入模块: from fudge import Fake [as 别名]
# 或者: from fudge.Fake import execute [as 别名]
def test_startswith_fail(self):
db = Fake("db").expects("execute").with_args(arg.startswith("insert into"))
db.execute("select from")