Skip to content

Commit eacef77

Browse files
committed
Update integration tests error code for invalid fid target
1 parent 3ee857c commit eacef77

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

firebase_admin/_messaging_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,8 @@ def __init__(self, message, cause=None, http_response=None):
519519
class UnregisteredError(exceptions.NotFoundError):
520520
"""App instance was unregistered from FCM.
521521
522-
This usually means that the token used is no longer valid and a new one must be used."""
522+
This usually means that the registration token or installation ID (FID) used
523+
is no longer valid and a new one must be used."""
523524

524525
def __init__(self, message, cause=None, http_response=None):
525526
exceptions.NotFoundError.__init__(self, message, cause, http_response)

integration/test_messaging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_send_invalid_fid():
9292
fid='not-a-fid',
9393
notification=messaging.Notification('test-title', 'test-body')
9494
)
95-
with pytest.raises(exceptions.InvalidArgumentError):
95+
with pytest.raises(messaging.UnregisteredError):
9696
messaging.send(msg, dry_run=True)
9797

9898
def test_send_each():
@@ -169,7 +169,7 @@ def test_send_each_for_multicast_fids():
169169
assert len(batch_response.responses) == 2
170170
for response in batch_response.responses:
171171
assert response.success is False
172-
assert response.exception is not None
172+
assert isinstance(response.exception, messaging.UnregisteredError)
173173
assert response.message_id is None
174174

175175
def test_subscribe():

0 commit comments

Comments
 (0)