MCPcopy Index your code
hub / github.com/PyMySQL/PyMySQL / test_blob

Method test_blob

pymysql/tests/test_basic.py:150–159  ·  view source on GitHub ↗

test blob data

(self)

Source from the content-addressed store, hash-verified

148 self.assertEqual(data, c.fetchone()[0])
149
150 def test_blob(self):
151 """test blob data"""
152 data = bytes(bytearray(range(256)) * 4)
153 conn = self.connect()
154 self.safe_create_table(conn, "test_blob", "create table test_blob (b blob)")
155
156 with conn.cursor() as c:
157 c.execute("insert into test_blob (b) values (_binary %s)", (data,))
158 c.execute("select b from test_blob")
159 self.assertEqual(data, c.fetchone()[0])
160
161 def test_untyped(self):
162 """test conversion of null, empty string"""

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected