forked from clearbit/clearbit-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request clearbit#18 from clearbit/rh-prospector-titles
Send title params as the API expects them.
- Loading branch information
Showing
3 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,5 +107,16 @@ def test_endpoint(self, requests): | |
Enrichment.find(email='[email protected]') | ||
requests.get.assert_called_with('https://person.clearbit.com/v2/combined/find', params={'email': '[email protected]'}, auth=('k', '')) | ||
|
||
class TestProspector(unittest.TestCase): | ||
@patch('clearbit.resource.requests') | ||
def test_search(self, requests): | ||
Prospector.search(domain='example.com') | ||
requests.get.assert_called_with('https://prospector.clearbit.com/v1/people/search', params={'domain': 'example.com'}, auth=('k', '')) | ||
|
||
@patch('clearbit.resource.requests') | ||
def test_search_titles(self, requests): | ||
Prospector.search(domain='example.com', titles=['Sales Director', 'Marketing Director']) | ||
requests.get.assert_called_with('https://prospector.clearbit.com/v1/people/search', params={'domain': 'example.com', 'titles[]': ['Sales Director', 'Marketing Director']}, auth=('k', '')) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |