Skip to content

Commit

Permalink
simplify type check, remove redundant test
Browse files Browse the repository at this point in the history
  • Loading branch information
rajumsys committed Mar 6, 2017
1 parent 67b464e commit a99c5aa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion sparkpost/transmissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
7 changes: 0 additions & 7 deletions test/test_transmissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit a99c5aa

Please sign in to comment.