summaryrefslogtreecommitdiff
path: root/test/suite/test_cursor_tracker.py
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2015-03-31 14:26:00 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2015-03-31 14:26:00 +1100
commit674170067c4016455e78d14ec24e3641d047f1c4 (patch)
tree7675fc5b3a4bd74d798a80c1bb118f5b0abe5d6e /test/suite/test_cursor_tracker.py
parente947f84b7b3f198bc09278a8be1c80a02d23f250 (diff)
downloadmongo-674170067c4016455e78d14ec24e3641d047f1c4.tar.gz
Add a __setitem__ to cursors in the Python API, remove lots of boilerplate c.set_key ... c.set_value ... c.insert code.
Diffstat (limited to 'test/suite/test_cursor_tracker.py')
-rw-r--r--test/suite/test_cursor_tracker.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/test/suite/test_cursor_tracker.py b/test/suite/test_cursor_tracker.py
index f25def3e1cc..1fa93f3e59b 100644
--- a/test/suite/test_cursor_tracker.py
+++ b/test/suite/test_cursor_tracker.py
@@ -156,12 +156,8 @@ class TestCursorTracker(wttest.WiredTigerTestCase):
for i in range(npairs):
wtkey = self.encode_key(i << 32)
wtval = self.encode_value(i << 32)
- self.traceapi('cursor.set_key(' + str(wtkey) + ')')
- cursor.set_key(wtkey)
- self.traceapi('cursor.set_value(' + str(wtval) + ')')
- cursor.set_value(wtval)
- self.traceapi('cursor.insert()')
- cursor.insert()
+ self.traceapi('cursor[' + str(wtkey) + '] = ' + str(wtval))
+ cursor[wtkey] = wtval
cursor.close()
self.pr('reopening the connection')
self.conn.close()
@@ -316,12 +312,8 @@ class TestCursorTracker(wttest.WiredTigerTestCase):
self.setpos(pos, True)
wtkey = self.encode_key(bits)
wtval = self.encode_value(bits)
- self.traceapi('cursor.set_key(' + str(wtkey) + ')')
- cursor.set_key(wtkey)
- self.traceapi('cursor.set_value(' + str(wtval) + ')')
- cursor.set_value(wtval)
- self.traceapi('cursor.insert()')
- cursor.insert()
+ self.traceapi('cursor[' + str(wtkey) + '] = ' + str(wtval))
+ cursor[wtkey] = wtval
def cur_remove_here(self, cursor):
# TODO: handle the exception case