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

Method test_blob

pymysql/tests/test_basic.py:149–158  ·  view source on GitHub ↗

test blob data

(self)

Source from the content-addressed store, hash-verified

147 self.assertEqual(data, c.fetchone()[0])
148
149 def test_blob(self):
150 """test blob data"""
151 data = bytes(bytearray(range(256)) * 4)
152 conn = self.connect()
153 self.safe_create_table(conn, "test_blob", "create table test_blob (b blob)")
154
155 with conn.cursor() as c:
156 c.execute("insert into test_blob (b) values (_binary %s)", (data,))
157 c.execute("select b from test_blob")
158 self.assertEqual(data, c.fetchone()[0])
159
160 def test_untyped(self):
161 """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