summaryrefslogtreecommitdiff
path: root/service/test/unit/user_agent_test.py
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-10-15 13:57:13 +0200
committerDuda Dornelles <ddornell@thoughtworks.com>2014-10-15 14:21:26 +0200
commitac3ea5d3838b98b07d182d71f2f3d9f270b5d274 (patch)
tree2aee9e4138d5732ff6890dd07a8a62de7f90d583 /service/test/unit/user_agent_test.py
parent89d26f3cd389f41b83d27ea225944a0ff8bc2e95 (diff)
Extracting controller classes
Diffstat (limited to 'service/test/unit/user_agent_test.py')
-rw-r--r--service/test/unit/user_agent_test.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/service/test/unit/user_agent_test.py b/service/test/unit/user_agent_test.py
index 0ea83a5d..49a70dd6 100644
--- a/service/test/unit/user_agent_test.py
+++ b/service/test/unit/user_agent_test.py
@@ -46,34 +46,6 @@ class UserAgentTest(unittest.TestCase):
def tearDown(self):
unstub()
- def test_sending_mail_return_sent_mail_data_when_send_succeeds(self):
- self.input_mail = test_helper.input_mail()
- when(self.mail_service).send(1, self.input_mail).thenReturn(self.input_mail)
- self.input_mail.as_dict = lambda: {'header': {'from': 'a@a.a', 'to': 'b@b.b'},
- 'ident': 1,
- 'tags': [],
- 'status': [],
- 'security_casing': {},
- 'body': 'email body'}
-
- result = self.app.post('/mails', data='{"ident":1}', content_type="application/json")
-
- self.assertEqual(result.status_code, 200)
- self.assertEqual(result.data, '{"status": [], "body": "email body", "ident": 1, "tags": [], "header": {"to": "b@b.b", "from": "a@a.a"}, "security_casing": {}}')
-
- def test_sending_mail_return_error_message_when_send_fails(self):
- self.input_mail = test_helper.input_mail()
-
- def send_that_throws_exception(id, mail):
- raise Exception('email sending failed', 'more information of error')
-
- self.mail_service.send = send_that_throws_exception
-
- result = self.app.post('/mails', data='{"ident":1}', content_type="application/json")
-
- self.assertEqual(result.status_code, 500)
- self.assertEqual(result.data, '{"message": "email sending failed\\nmore information of error"}')
-
def test_that_default_config_file_is_home_dot_pixelated(self):
orig_config = pixelated.user_agent.app.config
try: