Annotate zerver/tests/test_push_notifications.py.

This commit is contained in:
Umair Khan 2016-09-12 11:09:43 +05:00 committed by Tim Abbott
parent c231a440cd
commit 593779a3b0
1 changed files with 10 additions and 6 deletions

View File

@ -2,6 +2,7 @@ import mock
from mock import call
import time
from typing import Any, Union, SupportsInt
from six import text_type
import gcmclient
@ -246,8 +247,9 @@ class GCMCanonicalTest(GCMTest):
res.needs_retry.return_value = False
mock_send.return_value = res
def get_count(token):
token = apn.hex_to_b64(token)
def get_count(hex_token):
# type: (text_type) -> int
token = apn.hex_to_b64(hex_token)
return PushDeviceToken.objects.filter(
token=token, kind=PushDeviceToken.GCM).count()
@ -275,8 +277,9 @@ class GCMCanonicalTest(GCMTest):
res.needs_retry.return_value = False
mock_send.return_value = res
def get_count(token):
token = apn.hex_to_b64(token)
def get_count(hex_token):
# type: (text_type) -> int
token = apn.hex_to_b64(hex_token)
return PushDeviceToken.objects.filter(
token=token, kind=PushDeviceToken.GCM).count()
@ -302,8 +305,9 @@ class GCMNotRegisteredTest(GCMTest):
res.needs_retry.return_value = False
mock_send.return_value = res
def get_count(token):
token = apn.hex_to_b64(token)
def get_count(hex_token):
# type: (text_type) -> int
token = apn.hex_to_b64(hex_token)
return PushDeviceToken.objects.filter(
token=token, kind=PushDeviceToken.GCM).count()