MCPcopy Create free account
hub / github.com/PyMySQL/PyMySQL / test_dict

Method test_dict

pymysql/tests/test_basic.py:97–110  ·  view source on GitHub ↗

test dict escaping

(self)

Source from the content-addressed store, hash-verified

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