From a99c5aa06e9ab104ead7374a184adb13cf7ba874 Mon Sep 17 00:00:00 2001 From: mhossain Date: Mon, 6 Mar 2017 10:26:40 -0500 Subject: [PATCH] simplify type check, remove redundant test --- sparkpost/transmissions.py | 2 +- test/test_transmissions.py | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/sparkpost/transmissions.py b/sparkpost/transmissions.py index da79cc9..667b891 100644 --- a/sparkpost/transmissions.py +++ b/sparkpost/transmissions.py @@ -139,7 +139,7 @@ def _parse_address(self, address): def _extract_recipients(self, recipients): - if not (isinstance(recipients, list) or isinstance(recipients, dict)): + if not (isinstance(recipients, (list, dict))): raise SparkPostException('recipients must be a list or dict') formatted_recipients = [] diff --git a/test/test_transmissions.py b/test/test_transmissions.py index f9ec23a..a5d6ae0 100644 --- a/test/test_transmissions.py +++ b/test/test_transmissions.py @@ -28,13 +28,6 @@ def test_translate_keys_with_recips(): {'key': 'value'}, {'address': {'email': 'foobar'}}] - results = t._translate_keys( - recipients=[{'address': {'name': 'foo', 'email': 'bar'}}] - ) - assert results['recipients'] == [ - {'address': {'name': 'foo', 'email': 'bar'}} - ] - def test_exceptions_for_recipients(): t = Transmissions('uri', 'key')