X7ROOT File Manager
Current Path:
/lib/python2.7/site-packages/pymysql/tests
lib
/
python2.7
/
site-packages
/
pymysql
/
tests
/
📁
..
📄
__init__.py
(600 B)
📄
__init__.pyc
(773 B)
📄
__init__.pyo
(773 B)
📄
base.py
(2.64 KB)
📄
base.pyc
(3.64 KB)
📄
base.pyo
(3.64 KB)
📄
test_DictCursor.py
(4.51 KB)
📄
test_DictCursor.pyc
(5.21 KB)
📄
test_DictCursor.pyo
(5.21 KB)
📄
test_SSCursor.py
(3.83 KB)
📄
test_SSCursor.pyc
(3.29 KB)
📄
test_SSCursor.pyo
(3.29 KB)
📄
test_basic.py
(14.54 KB)
📄
test_basic.pyc
(14.09 KB)
📄
test_basic.pyo
(14.09 KB)
📄
test_connection.py
(23.71 KB)
📄
test_connection.pyc
(24.2 KB)
📄
test_connection.pyo
(24.16 KB)
📄
test_converters.py
(2.14 KB)
📄
test_converters.pyc
(3.51 KB)
📄
test_converters.pyo
(3.51 KB)
📄
test_cursor.py
(4.09 KB)
📄
test_cursor.pyc
(4.25 KB)
📄
test_cursor.pyo
(4.21 KB)
📄
test_err.py
(670 B)
📄
test_err.pyc
(1.29 KB)
📄
test_err.pyo
(1.29 KB)
📄
test_issues.py
(19.8 KB)
📄
test_issues.pyc
(19.88 KB)
📄
test_issues.pyo
(19.82 KB)
📄
test_load_local.py
(3.5 KB)
📄
test_load_local.pyc
(3.93 KB)
📄
test_load_local.pyo
(3.93 KB)
📄
test_nextset.py
(1.81 KB)
📄
test_nextset.pyc
(2.88 KB)
📄
test_nextset.pyo
(2.88 KB)
📄
test_optionfile.py
(737 B)
📄
test_optionfile.pyc
(1.25 KB)
📄
test_optionfile.pyo
(1.25 KB)
📁
thirdparty
Editing: test_nextset.py
import unittest2 from pymysql.tests import base from pymysql import util class TestNextset(base.PyMySQLTestCase): def setUp(self): super(TestNextset, self).setUp() self.con = self.connections[0] def test_nextset(self): cur = self.con.cursor() cur.execute("SELECT 1; SELECT 2;") self.assertEqual([(1,)], list(cur)) r = cur.nextset() self.assertTrue(r) self.assertEqual([(2,)], list(cur)) self.assertIsNone(cur.nextset()) def test_skip_nextset(self): cur = self.con.cursor() cur.execute("SELECT 1; SELECT 2;") self.assertEqual([(1,)], list(cur)) cur.execute("SELECT 42") self.assertEqual([(42,)], list(cur)) def test_ok_and_next(self): cur = self.con.cursor() cur.execute("SELECT 1; commit; SELECT 2;") self.assertEqual([(1,)], list(cur)) self.assertTrue(cur.nextset()) self.assertTrue(cur.nextset()) self.assertEqual([(2,)], list(cur)) self.assertFalse(bool(cur.nextset())) @unittest2.expectedFailure def test_multi_cursor(self): cur1 = self.con.cursor() cur2 = self.con.cursor() cur1.execute("SELECT 1; SELECT 2;") cur2.execute("SELECT 42") self.assertEqual([(1,)], list(cur1)) self.assertEqual([(42,)], list(cur2)) r = cur1.nextset() self.assertTrue(r) self.assertEqual([(2,)], list(cur1)) self.assertIsNone(cur1.nextset()) def test_multi_statement_warnings(self): cursor = self.con.cursor() try: cursor.execute('DROP TABLE IF EXISTS a; ' 'DROP TABLE IF EXISTS b;') except TypeError: self.fail() #TODO: How about SSCursor and nextset? # It's very hard to implement correctly...
Upload File
Create Folder