MCPcopy Create free account
hub / github.com/PyMySQL/mysqlclient / test_mogrify_with_dict_args

Function test_mogrify_with_dict_args

tests/test_cursor.py:179–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

177
178
179def test_mogrify_with_dict_args():
180 conn = connect()
181 cursor = conn.cursor()
182
183 query_with_args = "SELECT %(a)s, %(b)s", {"a": 1, "b": 2}
184 mogrified_query = cursor.mogrify(*query_with_args)
185 cursor.execute(*query_with_args)
186
187 assert mogrified_query == "SELECT 1, 2"
188 assert mogrified_query == cursor._executed.decode()
189
190
191# Test that cursor can be used without reading whole resultset.

Callers

nothing calls this directly

Calls 4

cursorMethod · 0.80
mogrifyMethod · 0.80
executeMethod · 0.80
connectFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…