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

Method test_binary

pymysql/tests/test_basic.py:137–148  ·  view source on GitHub ↗

test binary data

(self)

Source from the content-addressed store, hash-verified

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