Skip to content

Commit a99c5aa

Browse files
committed
simplify type check, remove redundant test
1 parent 67b464e commit a99c5aa

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

sparkpost/transmissions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def _parse_address(self, address):
139139

140140
def _extract_recipients(self, recipients):
141141

142-
if not (isinstance(recipients, list) or isinstance(recipients, dict)):
142+
if not (isinstance(recipients, (list, dict))):
143143
raise SparkPostException('recipients must be a list or dict')
144144

145145
formatted_recipients = []

test/test_transmissions.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ def test_translate_keys_with_recips():
2828
{'key': 'value'},
2929
{'address': {'email': 'foobar'}}]
3030

31-
results = t._translate_keys(
32-
recipients=[{'address': {'name': 'foo', 'email': 'bar'}}]
33-
)
34-
assert results['recipients'] == [
35-
{'address': {'name': 'foo', 'email': 'bar'}}
36-
]
37-
3831

3932
def test_exceptions_for_recipients():
4033
t = Transmissions('uri', 'key')

0 commit comments

Comments
 (0)