33
33
NON_OBJECT_ARGS = [list (), tuple (), dict (), 'foo' , 0 , 1 , True , False ]
34
34
NON_LIST_ARGS = ['' , tuple (), dict (), True , False , 1 , 0 , [1 ], ['foo' , 1 ]]
35
35
NON_UINT_ARGS = ['1.23s' , list (), tuple (), dict (), - 1.23 ]
36
- NON_BOOL_ARGS = ['' , list (), tuple (), dict (), 1 , 0 , [1 ], ['foo' , 1 ], {1 : 'foo' }, {'foo' : 1 }]
37
36
HTTP_ERROR_CODES = {
38
37
400 : exceptions .InvalidArgumentError ,
39
38
403 : exceptions .PermissionDeniedError ,
@@ -250,7 +249,7 @@ def test_fcm_options(self):
250
249
topic = 'topic' ,
251
250
fcm_options = messaging .FCMOptions ('message-label' ),
252
8000
251
android = messaging .AndroidConfig (
253
- fcm_options = messaging .AndroidFCMOptions ('android-label' , False )),
252
+ fcm_options = messaging .AndroidFCMOptions ('android-label' )),
254
253
apns = messaging .APNSConfig (fcm_options =
255
254
messaging .APNSFCMOptions (
256
255
analytics_label = 'apns-label' ,
@@ -260,8 +259,7 @@ def test_fcm_options(self):
260
259
{
261
260
'topic' : 'topic' ,
262
261
'fcm_options' : {'analytics_label' : 'message-label' },
263
- 'android' : {'fcm_options' : {'analytics_label' : 'android-label' ,
264
- 'direct_boot_ok' : False ,}},
262
+ 'android' : {'fcm_options' : {'analytics_label' : 'android-label' }},
265
263
'apns' : {'fcm_options' : {'analytics_label' : 'apns-label' ,
266
264
'image' : 'https://images.unsplash.com/photo-14944386399'
267
265
'46-1ebd1d20bf85?fit=crop&w=900&q=60' }},
@@ -319,21 +317,6 @@ def test_invalid_data(self, data):
319
317
check_encoding (messaging .Message (
320
318
topic = 'topic' , android = messaging .AndroidConfig (data = data )))
321
319
322
- @pytest .mark .parametrize ('data' , NON_STRING_ARGS )
323
- def test_invalid_analytics_label (self , data ):
324
- with pytest .raises (ValueError ):
325
- check_encoding (messaging .Message (
326
- topic = 'topic' , android = messaging .AndroidConfig (
327
- fcm_options = messaging .AndroidFCMOptions (analytics_label = data ))))
328
-
329
- @pytest .mark .parametrize ('data' , NON_BOOL_ARGS )
330
- def test_invalid_direct_boot_ok (self , data ):
331
- with pytest .raises (ValueError ):
332
- check_encoding (messaging .Message (
333
- topic = 'topic' , android = messaging .AndroidConfig (
334
- fcm_options = messaging .AndroidFCMOptions (direct_boot_ok = data ))))
335
-
336
-
337
320
def test_android_config (self ):
338
321
msg = messaging .Message (
339
322
topic = 'topic' ,
@@ -343,7 +326,7 @@ def test_android_config(self):
343
326
priority = 'high' ,
344
327
ttl = 123 ,
345
328
data = {'k1' : 'v1' , 'k2' : 'v2' },
346
- fcm_options = messaging .AndroidFCMOptions ('analytics_label_v1' , True )
329
+ fcm_options = messaging .AndroidFCMOptions ('analytics_label_v1' )
347
330
)
348
331
)
349
332
expected = {
@@ -359,7 +342,6 @@ def test_android_config(self):
359
342
},
360
343
'fcm_options' : {
361
344
'analytics_label' : 'analytics_label_v1' ,
362
- 'direct_boot_ok' : True ,
363
345
},
364
346
},
365
347
}
0 commit comments