Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate type of recipients #141

Merged
merged 4 commits into from
Mar 7, 2017
Merged

Validate type of recipients #141

merged 4 commits into from
Mar 7, 2017

Conversation

rajumsys
Copy link
Contributor

@rajumsys rajumsys commented Mar 2, 2017

Resolves #138

@@ -28,6 +28,19 @@ def test_translate_keys_with_recips():
{'key': 'value'},
{'address': {'email': 'foobar'}}]

results = t._translate_keys(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this testing differently than the above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wanted to test a different data structure but looks like redundant. i've removed it.

@@ -137,6 +138,10 @@ def _parse_address(self, address):
return parsed_address

def _extract_recipients(self, recipients):

if not (isinstance(recipients, list) or isinstance(recipients, dict)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can pass a tuple as the second argument to isinstance like so:

isinstance(recipients, (list, dict))

@rajumsys
Copy link
Contributor Author

rajumsys commented Mar 6, 2017

@richleland done with requested changes

@rajumsys rajumsys merged commit 266b3a7 into master Mar 7, 2017
@richleland richleland deleted the issue138 branch March 8, 2017 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants