File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -250,6 +250,24 @@ def test_unmarshal_with_custom_object(self):
250
250
self .assertEqual ("1" , event ['object' ]['metadata' ]['resourceVersion' ])
251
251
self .assertEqual ("1" , w .resource_version )
252
252
253
+ # ref: gh-982
254
+ def test_unmarshal_with_object_literal (self ):
255
+ from json import dumps
256
+ w = Watch ()
257
+ simple_object = {'hello' : 'world' , 'object' : {}}
258
+ object_literal = dumps (simple_object )
259
+ event = w .unmarshal_event (object_literal , 'str' )
260
+ self .assertTrue (isinstance (event , str ))
261
+ self .assertEqual (object_literal , event )
262
+
263
+ # ref: gh-983
264
+ def test_unmarshal_with_int_literal (self ):
265
+ w = Watch ()
266
+ int_literal = '1145141919'
267
+ event = w .unmarshal_event (int_literal , 'str' )
268
+ self .assertTrue (isinstance (event , str ))
269
+ self .assertEqual (int_literal , event )
270
+
253
271
def test_watch_with_exception (self ):
254
272
fake_resp = Mock ()
255
273
fake_resp .close = Mock ()
You can’t perform that action at this time.
0 commit comments