File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change
1
+ import sys
2
+ import decimal
1
3
from tests import unittest , OrderedDict
2
4
3
5
import jmespath
@@ -43,3 +45,14 @@ def test_can_compare_strings(self):
43
45
# This is python specific behavior that's not in the official spec
44
46
# yet, but this was regression from 0.9.0 so it's been added back.
45
47
self .assertTrue (jmespath .search ('a < b' , {'a' : '2016' , 'b' : '2017' }))
48
+
49
+ @unittest .skipIf (not hasattr (sys , 'maxint' ), 'Test requires long() type' )
50
+ def test_can_handle_long_ints (self ):
51
+ result = sys .maxint + 1
52
+ self .assertEqual (jmespath .search ('[?a >= `1`].a' , [{'a' : result }]),
53
+ [result ])
54
+
55
+ def test_can_handle_decimals_as_numeric_type (self ):
56
+ result = decimal .Decimal ('3' )
57
+ self .assertEqual (jmespath .search ('[?a >= `1`].a' , [{'a' : result }]),
58
+ [result ])
You can’t perform that action at this time.
0 commit comments