Skip to content

Commit

Permalink
Revert "Added tests."
Browse files Browse the repository at this point in the history
This reverts commit 9288589.
  • Loading branch information
jonathanedey committed Nov 20, 2023
1 parent 580d293 commit 1a1b3f0
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions tests/test_messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
NON_OBJECT_ARGS = [list(), tuple(), dict(), 'foo', 0, 1, True, False]
NON_LIST_ARGS = ['', tuple(), dict(), True, False, 1, 0, [1], ['foo', 1]]
NON_UINT_ARGS = ['1.23s', list(), tuple(), dict(), -1.23]
NON_BOOL_ARGS = ['', list(), tuple(), dict(), 1, 0, [1], ['foo', 1], {1: 'foo'}, {'foo': 1}]
HTTP_ERROR_CODES = {
400: exceptions.InvalidArgumentError,
403: exceptions.PermissionDeniedError,
Expand Down Expand Up @@ -250,7 +249,7 @@ def test_fcm_options(self):
topic='topic',
fcm_options=messaging.FCMOptions('message-label'),
android=messaging.AndroidConfig(
fcm_options=messaging.AndroidFCMOptions('android-label', False)),
fcm_options=messaging.AndroidFCMOptions('android-label')),
apns=messaging.APNSConfig(fcm_options=
messaging.APNSFCMOptions(
analytics_label='apns-label',
Expand All @@ -260,8 +259,7 @@ def test_fcm_options(self):
{
'topic': 'topic',
'fcm_options': {'analytics_label': 'message-label'},
'android': {'fcm_options': {'analytics_label': 'android-label',
'direct_boot_ok': False,}},
'android': {'fcm_options': {'analytics_label': 'android-label'}},
'apns': {'fcm_options': {'analytics_label': 'apns-label',
'image': 'https://images.unsplash.com/photo-14944386399'
'46-1ebd1d20bf85?fit=crop&w=900&q=60'}},
Expand Down Expand Up @@ -319,21 +317,6 @@ def test_invalid_data(self, data):
check_encoding(messaging.Message(
topic='topic', android=messaging.AndroidConfig(data=data)))

@pytest.mark.parametrize('data', NON_STRING_ARGS)
def test_invalid_analytics_label(self, data):
with pytest.raises(ValueError):
check_encoding(messaging.Message(
topic='topic', android=messaging.AndroidConfig(
fcm_options=messaging.AndroidFCMOptions(analytics_label=data))))

@pytest.mark.parametrize('data', NON_BOOL_ARGS)
def test_invalid_direct_boot_ok(self, data):
with pytest.raises(ValueError):
check_encoding(messaging.Message(
topic='topic', android=messaging.AndroidConfig(
fcm_options=messaging.AndroidFCMOptions(direct_boot_ok=data))))


def test_android_config(self):
msg = messaging.Message(
topic='topic',
Expand All @@ -343,7 +326,7 @@ def test_android_config(self):
priority='high',
ttl=123,
data={'k1': 'v1', 'k2': 'v2'},
fcm_options=messaging.AndroidFCMOptions('analytics_label_v1', True)
fcm_options=messaging.AndroidFCMOptions('analytics_label_v1')
)
)
expected = {
Expand All @@ -359,7 +342,6 @@ def test_android_config(self):
},
'fcm_options': {
'analytics_label': 'analytics_label_v1',
'direct_boot_ok': True,
},
},
}
Expand Down

0 comments on commit 1a1b3f0

Please sign in to comment.