MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / testEscaping

Method testEscaping

src/Test/TestDb.py:89–107  ·  view source on GitHub ↗
(self, db)

Source from the content-addressed store, hash-verified

87 ).fetchone()["num"] == 1
88
89 def testEscaping(self, db):
90 # Test insert
91 for i in range(100):
92 db.execute("INSERT INTO test ?", {"test_id": i, "title": "Test '\" #%s" % i})
93
94 assert db.execute(
95 "SELECT COUNT(*) AS num FROM test WHERE ?",
96 {"title": "Test '\" #1"}
97 ).fetchone()["num"] == 1
98
99 assert db.execute(
100 "SELECT COUNT(*) AS num FROM test WHERE ?",
101 {"title": ["Test '\" #%s" % i for i in range(0, 50)]}
102 ).fetchone()["num"] == 50
103
104 assert db.execute(
105 "SELECT COUNT(*) AS num FROM test WHERE ?",
106 {"not__title": ["Test '\" #%s" % i for i in range(50, 3000)]}
107 ).fetchone()["num"] == 50
108
109
110 def testUpdateJson(self, db):

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected