Fix skipped cursor unit tests

This commit is contained in:
Nick Hall 2017-03-10 21:20:47 +00:00
parent 638f590eb3
commit e59aa0c907

View File

@ -142,8 +142,8 @@ class CursorTest(unittest.TestCase):
self.assertEqual(v.handle, data.handle) self.assertEqual(v.handle, data.handle)
def test_insert_with_curor_closed(self): def test_insert_with_cursor_closed(self):
"""test_insert_with_curor_closed""" """test_insert_with_cursor_closed"""
cursor_txn = self.env.txn_begin() cursor_txn = self.env.txn_begin()
@ -162,9 +162,8 @@ class CursorTest(unittest.TestCase):
self.assertEqual(v.handle, data.handle) self.assertEqual(v.handle, data.handle)
@unittest.skip("Insert expected to fail with open cursor") def test_insert_with_cursor_open(self):
def test_insert_with_curor_open(self): """test_insert_with_cursor_open"""
"""test_insert_with_curor_open"""
cursor_txn = self.env.txn_begin() cursor_txn = self.env.txn_begin()
cursor = self.surnames.cursor(txn=cursor_txn) cursor = self.surnames.cursor(txn=cursor_txn)
@ -172,9 +171,7 @@ class CursorTest(unittest.TestCase):
cursor.next() cursor.next()
data = Data(b'2', 'surname2', 'name2') data = Data(b'2', 'surname2', 'name2')
the_txn = self.env.txn_begin() self.person_map.put(data.handle, data, txn=cursor_txn)
self.person_map.put(data.handle, data, txn=the_txn)
the_txn.commit()
cursor.close() cursor.close()
cursor_txn.commit() cursor_txn.commit()
@ -183,9 +180,8 @@ class CursorTest(unittest.TestCase):
self.assertEqual(v.handle, data.handle) self.assertEqual(v.handle, data.handle)
@unittest.skip("Insert expected to fail with open cursor") def test_insert_with_cursor_open_and_db_open(self):
def test_insert_with_curor_open_and_db_open(self): """test_insert_with_cursor_open_and_db_open"""
"""test_insert_with_curor_open_and_db_open"""
(person2,surnames2) = self._open_tables() (person2,surnames2) = self._open_tables()
@ -195,9 +191,7 @@ class CursorTest(unittest.TestCase):
cursor.next() cursor.next()
data = Data(b'2', 'surname2', 'name2') data = Data(b'2', 'surname2', 'name2')
the_txn = self.env.txn_begin() self.person_map.put(data.handle, data, txn=cursor_txn)
self.person_map.put(data.handle, data, txn=the_txn)
the_txn.commit()
cursor.close() cursor.close()
cursor_txn.commit() cursor_txn.commit()