Skip to content

Navigation Menu

Sign in
Appearance settings

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 dbd7a3d

Browse filesBrowse files
committed
Fix failing tests
1 parent 1cc9494 commit dbd7a3d
Copy full SHA for dbd7a3d

File tree

Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed

‎pymysql/tests/test_issues.py

Copy file name to clipboardExpand all lines: pymysql/tests/test_issues.py
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def test_issue_364(self):
415415

416416
sql = "insert into issue364 (value_1, value_2) values (%s, %s)"
417417
usql = u"insert into issue364 (value_1, value_2) values (%s, %s)"
418-
values = [b"\x00\xff\x00", u"\xe4\xf6\xfc"]
418+
values = [pymysql.Binary(b"\x00\xff\x00"), u"\xe4\xf6\xfc"]
419419

420420
# test single insert and select
421421
cur = conn.cursor()
@@ -450,26 +450,26 @@ def test_issue_363(self):
450450
if sys.version_info[0:2] >= (3,2) and self.mysql_server_is(conn, (5, 7, 0)):
451451
with self.assertWarns(pymysql.err.Warning) as cm:
452452
cur.execute("INSERT INTO issue363 (id, geom) VALUES ("
453-
"1998, GeomFromText('LINESTRING(1.1 1.1,2.2 2.2)'))")
453+
"1998, ST_GeomFromText('LINESTRING(1.1 1.1,2.2 2.2)'))")
454454
else:
455455
cur.execute("INSERT INTO issue363 (id, geom) VALUES ("
456-
"1998, GeomFromText('LINESTRING(1.1 1.1,2.2 2.2)'))")
456+
"1998, ST_GeomFromText('LINESTRING(1.1 1.1,2.2 2.2)'))")
457457

458458
# select WKT
459459
if sys.version_info[0:2] >= (3,2) and self.mysql_server_is(conn, (5, 7, 0)):
460460
with self.assertWarns(pymysql.err.Warning) as cm:
461-
cur.execute("SELECT AsText(geom) FROM issue363")
461+
cur.execute("SELECT ST_AsText(geom) FROM issue363")
462462
else:
463-
cur.execute("SELECT AsText(geom) FROM issue363")
463+
cur.execute("SELECT ST_AsText(geom) FROM issue363")
464464
row = cur.fetchone()
465465
self.assertEqual(row, ("LINESTRING(1.1 1.1,2.2 2.2)", ))
466466

467467
# select WKB
468468
if sys.version_info[0:2] >= (3,2) and self.mysql_server_is(conn, (5, 7, 0)):
469469
with self.assertWarns(pymysql.err.Warning) as cm:
470-
cur.execute("SELECT AsBinary(geom) FROM issue363")
470+
cur.execute("SELECT ST_AsBinary(geom) FROM issue363")
471471
else:
472-
cur.execute("SELECT AsBinary(geom) FROM issue363")
472+
cur.execute("SELECT ST_AsBinary(geom) FROM issue363")
473473
row = cur.fetchone()
474474
self.assertEqual(row,
475475
(b"\x01\x02\x00\x00\x00\x02\x00\x00\x00"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.