From 1e011d93d114b9f0c49e4e27ca4c22ef7783c850 Mon Sep 17 00:00:00 2001 From: Jeff Gregory Date: Sun, 23 Feb 2014 23:38:04 -0800 Subject: [PATCH] Test query search ordre Test that the order comes out as expected when doing a query --- tests/test_dynamodb2/test_dynamodb_table_with_range_key.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_dynamodb2/test_dynamodb_table_with_range_key.py b/tests/test_dynamodb2/test_dynamodb_table_with_range_key.py index b879600f8..0b8ce61c0 100644 --- a/tests/test_dynamodb2/test_dynamodb_table_with_range_key.py +++ b/tests/test_dynamodb2/test_dynamodb_table_with_range_key.py @@ -256,6 +256,11 @@ def test_query(): table.count().should.equal(4) + results = table.query(forum_name__eq='the-key', subject__gt='1',consistent=True) + expected = ["123", "456", "789"] + for index, item in enumerate(results): + item["subject"].should.equal(expected[index]) + results = table.query(forum_name__eq='the-key', subject__gt='1',consistent=True) sum(1 for _ in results).should.equal(3)