MCPcopy
hub / github.com/PyMySQL/PyMySQL / test_dict

Method test_dict

pymysql/tests/test_basic.py:98–111  ·  view source on GitHub ↗

test dict escaping

(self)

Source from the content-addressed store, hash-verified

96 c.execute("drop table test_datatypes")
97
98 def test_dict(self):
99 """test dict escaping"""
100 conn = self.connect()
101 c = conn.cursor()
102 c.execute("create table test_dict (a integer, b integer, c integer)")
103 try:
104 c.execute(
105 "insert into test_dict (a,b,c) values (%(a)s, %(b)s, %(c)s)",
106 {"a": 1, "b": 2, "c": 3},
107 )
108 c.execute("select a,b,c from test_dict")
109 self.assertEqual((1, 2, 3), c.fetchone())
110 finally:
111 c.execute("drop table test_dict")
112
113 def test_string(self):
114 conn = self.connect()

Callers

nothing calls this directly

Calls 4

cursorMethod · 0.80
executeMethod · 0.80
connectMethod · 0.45
fetchoneMethod · 0.45

Tested by

no test coverage detected