8000 Add binary field type test to basic tests (#596) · ammogcoder/PyMySQL@2b14488 · GitHub
[go: up one dir, main page]

Skip to content
Sign in

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2b14488

Browse files
JanKloppermethane
authored andcommitted
Add binary field type test to basic tests (PyMySQL#596)
1 parent 2fa7b14 commit 2b14488

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pymysql/tests/test_basic.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,20 @@ def test_integer(self):
9191
finally:
9292
c.execute("drop table test_dict")
9393

94-
def test_blob(self):
94+
def test_binary(self):
9595
"""test binary data"""
96+
data = bytes(bytearray(range(255)))
97+
conn = self.connections[0]
98+
self.safe_create_table(
99+
conn, "test_binary", "create table test_binary (b binary(255))")
100+
101+
with conn.cursor() as c:
102+
c.execute("insert into test_binary (b) values (%s)", (data,))
103+
c.execute("select b from test_binary")
104+
self.assertEqual(data, c.fetchone()[0])
105+
106+
def test_blob(self):
107+
"""test blob data"""
96108
data = bytes(bytearray(range(256)) * 4)
97109
conn = 4090 self.connections[0]
98110
self.safe_create_table(

0 commit comments

Comments
 (0)
0