This repository has been archived by the owner on Oct 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #7
- Loading branch information
Showing
19 changed files
with
76 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PyMySQL==0.5 | ||
gevent==1.0 | ||
greenlet==0.4.1 | ||
mock==1.0.1 | ||
nose==1.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from mock import patch, Mock | ||
import umysqldb.cursors as M | ||
|
||
|
||
def test_executemany_should_handle_on_duplicate_key_update_clause(): | ||
with patch.object(M.Cursor, '_query') as mock_query: | ||
sql = 'INSERT INTO _test(id,val) VALUES(%s,%s) ' \ | ||
'ON DUPLICATE KEY UPDATE id=VALUES(id),val=VALUES(val)' | ||
args = [(44495, 1), (44495, 2)] | ||
mock_conn = Mock() | ||
mock_conn.literal.side_effect = repr | ||
cursor = M.Cursor(mock_conn) | ||
cursor.executemany(sql, args) | ||
mock_query.assert_called_once_with( | ||
'INSERT INTO _test(id,val) VALUES\n(%s,%s),(%s,%s)\n ' | ||
'ON DUPLICATE KEY UPDATE id=VALUES(id),val=VALUES(val)', | ||
(44495, 1, 44495, 2)) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from pymysql.constants import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters