summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSean Morgan <seanmorgan91@gmail.com>2017-01-30 12:28:48 -0500
committerSean Morgan <spmorgan@micron.com>2017-01-30 12:28:48 -0500
commitba76beee9d4e435254813899f82ca72b5d237a91 (patch)
tree0bb4e8b3fc62b70a5ea10ecba9ecd755c947336c /tests
parente085b9c1b666421fbe309450669171d31b12d328 (diff)
downloadhappybase-ba76beee9d4e435254813899f82ca72b5d237a91.tar.gz
Rename to reverse, minor code fixes
Diffstat (limited to 'tests')
-rw-r--r--tests/test_api.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index 166fcd8..f5242a5 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -446,29 +446,32 @@ def test_scan_sorting():
list(row.items()))
-def test_scan_reversed():
+def test_scan_reverse():
+
if connection.compat < '0.98':
- return # not supported
+ with assert_raises(NotImplementedError):
+ list(table.scan(reverse=True))
+ return
with table.batch() as b:
for i in range(2000):
- b.put(('row-scan-reversed-%04d' % i).encode('ascii'),
+ b.put(('row-scan-reverse-%04d' % i).encode('ascii'),
{b'cf1:col1': b'v1',
b'cf1:col2': b'v2'})
- scan = table.scan(row_prefix=b'row-scan-reversed', reversed=True)
+ scan = table.scan(row_prefix=b'row-scan-reverse', reverse=True)
assert_equal(2000, len(list(scan)))
- scan = table.scan(reversed=True, limit=10)
+ scan = table.scan(limit=10, reverse=True)
assert_equal(10, len(list(scan)))
- scan = table.scan(row_start=b'row-scan-reversed-1999',
- row_stop=b'row-scan-reversed-0000', reversed=True)
+ scan = table.scan(row_start=b'row-scan-reverse-1999',
+ row_stop=b'row-scan-reverse-0000', reverse=True)
key, data = next(scan)
- assert_equal(b'row-scan-reversed-1999', key)
+ assert_equal(b'row-scan-reverse-1999', key)
key, data = list(scan)[-1]
- assert_equal(b'row-scan-reversed-0001', key)
+ assert_equal(b'row-scan-reverse-0001', key)
def test_scan_filter_and_batch_size():