Skip to content

Commit 7ff3bf6

Browse files
committed
Updated test for to_dict()
1 parent 1734f2a commit 7ff3bf6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/test_driver.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,11 @@ def to_dict(self):
10601060
d2 = cur.to_dict(row, d)
10611061
self.assertDictEqual(d2, sample)
10621062
self.assertIs(d, d2)
1063+
with self.assertRaises(AssertionError) as cm:
1064+
cur.to_dict([1])
1065+
cur.to_dict([1, 2, 3])
1066+
self.assertTupleEqual(cm.exception.args, ('Length of data must match number of fields',))
1067+
10631068

10641069
class TestScrollableCursor(DriverTestBase):
10651070
def setUp(self):

0 commit comments

Comments
 (0)