-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
28 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include VERSION |
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 |
---|---|---|
@@ -1 +1 @@ | ||
2.1.0 | ||
3.0.0 |
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 |
---|---|---|
|
@@ -5,8 +5,7 @@ | |
class TestClient(TestCase): | ||
def setUp(self): | ||
self.client = emailable.Client('test_7aff7fc0142c65f86a00') | ||
self.response = self.client.verify('[email protected]') | ||
time.sleep(0.25) | ||
time.sleep(0.5) | ||
|
||
def test_invalid_api_key(self): | ||
client = emailable.Client('test_7aff7fc0141c65f86a00') | ||
|
@@ -25,7 +24,8 @@ def test_missing_api_key(self): | |
) | ||
|
||
def test_verify_returns_response(self): | ||
self.assertIsInstance(self.response, emailable.Response) | ||
response = self.client.verify('[email protected]') | ||
self.assertIsInstance(response, emailable.Response) | ||
|
||
def test_verification_role(self): | ||
response = self.client.verify('[email protected]') | ||
|
@@ -36,26 +36,35 @@ def test_verification_deliverable(self): | |
self.assertEqual(response.state, 'deliverable') | ||
|
||
def test_verification_tag(self): | ||
self.assertEqual(self.response.tag, 'tag') | ||
response = self.client.verify('[email protected]') | ||
self.assertEqual(response.tag, 'tag') | ||
|
||
def test_verification_name_and_gender(self): | ||
response = self.client.verify('[email protected]') | ||
# name and gender checks only get run for certain verification states | ||
if self.response.state in ['deliverable', 'risky', 'unknown']: | ||
self.assertEqual(self.response.first_name, 'John') | ||
self.assertEqual(self.response.last_name, 'Doe') | ||
self.assertEqual(self.response.full_name, 'John Doe') | ||
self.assertEqual(self.response.gender, 'male') | ||
if response.state in ['deliverable', 'risky', 'unknown']: | ||
self.assertEqual(response.first_name, 'John') | ||
self.assertEqual(response.last_name, 'Doe') | ||
self.assertEqual(response.full_name, 'John Doe') | ||
self.assertEqual(response.gender, 'male') | ||
else: | ||
self.assertIsNone(self.response.first_name) | ||
self.assertIsNone(self.response.last_name) | ||
self.assertIsNone(self.response.full_name) | ||
self.assertIsNone(self.response.gender) | ||
self.assertIsNone(response.first_name) | ||
self.assertIsNone(response.last_name) | ||
self.assertIsNone(response.full_name) | ||
self.assertIsNone(response.gender) | ||
|
||
def test_batch_creation(self): | ||
response = self.client.batch( | ||
['[email protected]', '[email protected]'] | ||
) | ||
self.assertIsNotNone(response.id) | ||
|
||
def test_batch_creation_with_params(self): | ||
with self.assertRaises(emailable.error.ClientError): | ||
self.client.batch( | ||
['[email protected]', '[email protected]'], | ||
{'callback_url': '[email protected]', 'simulate': 'generic_error'} | ||
) | ||
|
||
def test_batch_status(self): | ||
response = self.client.batch( | ||
|