@@ -55,13 +55,13 @@ def test_invalid_tokens_type(self, tokens):
55
55
56
56
def test_tokens_over_one_hundred (self ):
57
57
with pytest .raises (ValueError ) as excinfo :
58
- messaging .MulticastMessage (tokens = ['token' for i in xrange (0 , 101 )])
58
+ messaging .MulticastMessage (tokens = ['token' for _ in range (0 , 101 )])
59
59
expected = 'MulticastMessage.tokens must not contain more than 100 tokens.'
60
60
assert str (excinfo .value ) == expected
61
61
62
62
def test_tokens_type (self ):
63
63
messaging .MulticastMessage (tokens = ['token' ])
64
- messaging .MulticastMessage (tokens = ['token' for i in xrange (0 , 100 )])
64
+ messaging .MulticastMessage (tokens = ['token' for _ in range (0 , 100 )])
65
65
66
66
67
67
class TestMessageEncoder (object ):
@@ -1401,7 +1401,7 @@ def test_invalid_send_all(self, msg):
1401
1401
def test_invalid_over_one_hundred (self ):
1402
1402
msg = messaging .Message (topic = 'foo' )
1403
1403
with pytest .raises (ValueError ) as excinfo :
1404
- messaging .send_all ([msg for i in xrange (0 , 101 )])
1404
+ messaging .send_all ([msg for _ in range (0 , 101 )])
1405
1405
expected = 'send_all messages must not contain more than 100 messages.'
1406
1406
assert str (excinfo .value ) == expected
1407
1407
@@ -1441,7 +1441,7 @@ def test_send_all_non_error_non_200_detailed_error(self):
1441
1441
payload = self ._batch_payload ([(200 , success_payload ), (202 , error_payload )]))
1442
1442
msg = messaging .Message (topic = 'foo' )
1443
1443
with pytest .raises (messaging .ApiCallError ) as excinfo :
1444
- batch_response = messaging .send_all ([msg , msg ], dry_run = True )
1444
+ messaging .send_all ([msg , msg ], dry_run = True )
1445
1445
assert str (excinfo .value ) == 'test error'
1446
1446
assert str (excinfo .value .code ) == 'invalid-argument'
1447
1447
@@ -1458,7 +1458,6 @@ def test_send_all_non_error_non_200_canonical_error_code(self):
1458
1458
msg = messaging .Message (topic = 'foo' )
1459
1459
with pytest .raises (messaging .ApiCallError ) as excinfo :
1460
1460
messaging .send_all ([msg , msg ], dry_run = True )
1461
- expected = 'send_all messages must not contain more than 100 messages.'
1462
1461
assert str (excinfo .value ) == 'test error'
1463
1462
assert str (excinfo .value .code ) == 'registration-token-not-registered'
1464
1463
@@ -1689,7 +1688,7 @@ def test_send_multicast_non_error_non_200_detailed_error(self):
1689
1688
payload = self ._batch_payload ([(200 , success_payload ), (202 , error_payload )]))
1690
1689
msg = messaging .MulticastMessage (tokens = ['foo' , 'foo' ])
1691
1690
with pytest .raises (messaging .ApiCallError ) as excinfo :
1692
- batch_response = messaging .send_multicast (msg , dry_run = True )
1691
+ messaging .send_multicast (msg , dry_run = True )
1693
1692
assert str (excinfo .value ) == 'test error'
1694
1693
assert str (excinfo .value .code ) == 'invalid-argument'
1695
1694
@@ -1788,7 +1787,7 @@ def test_send_multicast_canonical_error_code(self, status):
1788
1787
assert str (exception .code ) == 'registration-token-not-registered'
1789
1788
1790
1789
@pytest .mark .parametrize ('status' , HTTP_ERRORS )
1791
- def test_send_multicast_canonical_error_code (self , status ):
1790
+ def test_send_multicast_fcm_error_code (self , status ):
1792
1791
success_payload = json .dumps ({'name' : 'message-id' })
1793
1792
error_payload = json .dumps ({
1794
1793
'error' : {
0 commit comments