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

Method test_binary

pymysql/tests/test_basic.py:136–147  ·  view source on GitHub ↗

test binary data

(self)

Source from the content-addressed store, hash-verified

134 c.execute("drop table test_dict")
135
136 def test_binary(self):
137 """test binary data"""
138 data = bytes(bytearray(range(255)))
139 conn = self.connect()
140 self.safe_create_table(
141 conn, "test_binary", "create table test_binary (b binary(255))"
142 )
143
144 with conn.cursor() as c:
145 c.execute("insert into test_binary (b) values (_binary %s)", (data,))
146 c.execute("select b from test_binary")
147 self.assertEqual(data, c.fetchone()[0])
148
149 def test_blob(self):
150 """test blob data"""

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