File tree Expand file tree Collapse file tree 5 files changed +36
-19
lines changed Expand file tree Collapse file tree 5 files changed +36
-19
lines changed Original file line number Diff line number Diff line change 1
- __version__ = '0.11.3 '
1
+ __version__ = '0.11.4 '
2
2
from collections import defaultdict
3
3
import contextlib
4
4
Original file line number Diff line number Diff line change @@ -385,6 +385,10 @@ def make_constructors():
385
385
386
386
"""
387
387
388
+ # these keys have key/value data but it should not be expanded into a
389
+ # resource.
390
+ NON_EXPANDABLE_KEYS = ['meta' ]
391
+
388
392
def the_new (cls , ** kwargs ):
389
393
for key in kwargs .iterkeys ():
390
394
@@ -405,7 +409,7 @@ def the_init(self, **kwargs):
405
409
406
410
# iterate through the schema that comes back
407
411
for key , value in kwargs .iteritems ():
408
- if is_subresource (value ):
412
+ if key not in NON_EXPANDABLE_KEYS and is_subresource (value ):
409
413
# sub resources have a uri in them
410
414
uri = value ['uri' ]
411
415
try :
Original file line number Diff line number Diff line change 15
15
16
16
17
17
_JSON_ERROR_MSG = (
18
- 'Object of type {0} with value of {1} is not JSON serializable' )
18
+ 'Object of type {0} with value of {1} is not JSON serializable'
19
+ )
19
20
20
21
21
22
def iter_multi_items (mapping ):
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ def test_wrap_raise_for_status(self):
139
139
140
140
141
141
class TestConfigThread (threading .Thread ):
142
- def __init__ ( self ):
142
+ def __init__ (self ):
143
143
threading .Thread .__init__ (self )
144
144
self .key = False
145
145
Original file line number Diff line number Diff line change @@ -41,7 +41,17 @@ def test_redirects(self):
41
41
self .assertEqual (
42
42
exception .response .headers ['location' ],
43
43
'/v1/your-mom'
44
- )
44
+ )
45
+
46
+ def test_does_not_parse_meta (self ):
47
+ payload = {
48
+ 'uri' : '/v1/yo-momma' ,
49
+ 'meta' : {
50
+ 'uri' : 'None' ,
51
+ }
52
+ }
53
+
54
+ balanced .Account (** payload )
45
55
46
56
47
57
class TestPage (unittest .TestCase ):
@@ -67,20 +77,22 @@ def test_filter2(self):
67
77
68
78
self .assertDictEqual (
69
79
dict (parsed_qs ),
70
- {'a' : 'b' ,
71
- 'a[!=]' : '101' ,
72
- 'b[<=]' : '5' ,
73
- 'b[<]' : '4' ,
74
- 'c[>=]' : '44' ,
75
- 'c[>]' : '123' ,
76
- 'd[!in]' : '6,33,55' ,
77
- 'd[in]' : '1,2,3' ,
78
- 'e[!contains]' : 'soda' ,
79
- 'e[contains]' : 'it' ,
80
- 'f[endswith]' : 'lo' ,
81
- 'f[startswith]' : 'la' ,
82
- 'g' : '12' ,
83
- })
80
+ {
81
+ 'a' : 'b' ,
82
+ 'a[!=]' : '101' ,
83
+ 'b[<=]' : '5' ,
84
+ 'b[<]' : '4' ,
85
+ 'c[>=]' : '44' ,
86
+ 'c[>]' : '123' ,
87
+ 'd[!in]' : '6,33,55' ,
88
+ 'd[in]' : '1,2,3' ,
89
+ 'e[!contains]' : 'soda' ,
90
+ 'e[contains]' : 'it' ,
91
+ 'f[endswith]' : 'lo' ,
92
+ 'f[startswith]' : 'la' ,
93
+ 'g' : '12' ,
94
+ }
95
+ )
84
96
85
97
def test_sort (self ):
86
98
q = balanced .Marketplace .query
You can’t perform that action at this time.
0 commit comments