Skip to content
Browse files

Fixed bug that prevented BETWEEN condition from working.

  • Loading branch information...
1 parent 491eaf5 commit 1f02c4b9659d0a5f84625250fd2795a4916ee7d1 @dekked committed Nov 14, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 ddbmock/validators/types.py
View
7 ddbmock/validators/types.py
@@ -126,6 +126,8 @@ def f(v):
field_value.update(set_field_value)
single_str_num_bin_list = All(Length(min=1, max=1), [simple_field_value])
+double_str_num_bin_list = All(Length(min=2, max=2), [simple_field_value, simple_field_value])
+
single_str_bin_list = All(Length(min=1, max=1), [{
Optional(u'S'): field_string_value,
Optional(u'B'): field_binary_value,
@@ -167,9 +169,12 @@ def f(v):
# Conditions shared by query and scan
range_key_condition = Any(
{
- u"ComparisonOperator": Any(u"EQ", u"GT", u"GE", u"LT", u"LE", u"BETWEEN"),
+ u"ComparisonOperator": Any(u"EQ", u"GT", u"GE", u"LT", u"LE"),
u"AttributeValueList": single_str_num_bin_list,
},{
+ u"ComparisonOperator": u"BETWEEN",
+ u"AttributeValueList": double_str_num_bin_list,
+ },{
u"ComparisonOperator": u"BEGINS_WITH",
u"AttributeValueList": single_str_bin_list,
},

0 comments on commit 1f02c4b

Please sign in to comment.
Something went wrong with that request. Please try again.