Example #1
0
 def test_inactive_false(self, mock_request):
     mock_request.return_value = self.mock_response(self.json_response)
     b = Bounces()
     b.get(bounce_type='HardBounce', inactive=False, test=True)
     params = dict(type='HardBounce', inactive=False, count=25, offset=0)
     headers = b._get_headers(test=True)
     url = b._get_api_url(test=True)
     mock_request.assert_called_with(method='GET', url=url, headers=headers,
                                     params=params)
Example #2
0
 def test_message_id(self, mock_request):
     mock_request.return_value = self.mock_response(self.json_response)
     b = Bounces()
     b.get(bounce_type='HardBounce', message_id='xxx-yyy', test=True)
     params = dict(type='HardBounce', messageID='xxx-yyy')
     headers = b._get_headers(test=True)
     url = b._get_api_url(test=True)
     mock_request.assert_called_with(method='GET', url=url, headers=headers,
                                     params=params)
Example #3
0
 def test_email_filter(self, mock_request):
     mock_request.return_value = self.mock_response(self.json_response)
     b = Bounces()
     b.get(bounce_type='HardBounce', email_filter='@gmail.com', test=True)
     params = dict(type='HardBounce', emailFilter='@gmail.com', count=25,
                   offset=0)
     headers = b._get_headers(test=True)
     url = b._get_api_url(test=True)
     mock_request.assert_called_with(method='GET', url=url, headers=headers,
                                     params=params)
Example #4
0
 def test_bad_bounce_type(self, mock_request):
     mock_request.return_value = self.mock_response(self.json_response)
     b = Bounces()
     self.assertRaisesMessage(BounceError,
                              'Invalid bounce type',
                              b.get,
                              'xxx',
                              test=True)
Example #5
0
 def test_message_id(self, mock_request):
     mock_request.return_value = self.mock_response(self.json_response)
     b = Bounces()
     b.get(bounce_type='HardBounce', message_id='xxx-yyy', test=True)
     params = dict(type='HardBounce', messageID='xxx-yyy')
     headers = b._get_headers(test=True)
     url = b._get_api_url(test=True)
     mock_request.assert_called_with(method='GET', url=url, headers=headers,
                                     params=params)
Example #6
0
 def test_inactive_false(self, mock_request):
     mock_request.return_value = self.mock_response(self.json_response)
     b = Bounces()
     b.get(bounce_type='HardBounce', inactive=False, test=True)
     params = dict(type='HardBounce', inactive=False, count=25, offset=0)
     headers = b._get_headers(test=True)
     url = b._get_api_url(test=True)
     mock_request.assert_called_with(method='GET', url=url, headers=headers,
                                     params=params)
Example #7
0
 def test_email_filter(self, mock_request):
     mock_request.return_value = self.mock_response(self.json_response)
     b = Bounces()
     b.get(bounce_type='HardBounce', email_filter='@gmail.com', test=True)
     params = dict(type='HardBounce', emailFilter='@gmail.com', count=25,
                   offset=0)
     headers = b._get_headers(test=True)
     url = b._get_api_url(test=True)
     mock_request.assert_called_with(method='GET', url=url, headers=headers,
                                     params=params)