diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-08-28 17:08:15 -0300 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-08-28 17:08:15 -0300 |
commit | 8d720d413122ddcba43cc52ceaa13513ac23ac37 (patch) | |
tree | 1684645dd215d4421c44ad2bd9b749c43b82461f | |
parent | 42009ce9006a1c67df2dcebc6ff2002b36655682 (diff) |
fixing pep8
-rw-r--r-- | service/pixelated/adapter/mail_service.py | 2 | ||||
-rw-r--r-- | service/pixelated/user_agent.py | 4 | ||||
-rw-r--r-- | service/test/adapter/mail_service_test.py | 3 | ||||
-rw-r--r-- | service/test/adapter/pixelated_mail_test.py | 1 |
4 files changed, 5 insertions, 5 deletions
diff --git a/service/pixelated/adapter/mail_service.py b/service/pixelated/adapter/mail_service.py index 416c7bfc..48495d51 100644 --- a/service/pixelated/adapter/mail_service.py +++ b/service/pixelated/adapter/mail_service.py @@ -51,7 +51,7 @@ class MailService: def start(self): try: - self.smtp_server = self._create_smtp_server() + self.smtp_server = self._create_smtp_server() self.smtp_client = self._create_smtp_client(self.smtp_server.smtp_info()) except: traceback.print_exc(file=sys.stdout) diff --git a/service/pixelated/user_agent.py b/service/pixelated/user_agent.py index 4b234fe8..3e9eadaf 100644 --- a/service/pixelated/user_agent.py +++ b/service/pixelated/user_agent.py @@ -36,6 +36,7 @@ app.config.from_pyfile(os.path.join(os.environ['HOME'], '.pixelated')) leap_session = open_leap_session(app.config['LEAP_USERNAME'], app.config['LEAP_PASSWORD'], app.config['LEAP_SERVER_NAME']) mail_service = MailService(leap_session) + def respond_json(entity): response = json.dumps(entity) return Response(response=response, mimetype="application/json") @@ -58,6 +59,7 @@ def send_mail(): mail_service.send(mail) return respond_json(None) + @app.route('/mails', methods=['PUT']) def update_draft(): raw_mail = json.parse(request.json) @@ -127,10 +129,12 @@ def mark_mail_as_read(mail_id): def contacts(): pass + @app.route('/draft_reply_for/<mail_id>') def draft_reply_for(mail_id): pass + @app.route('/') def index(): return app.send_static_file('index.html') diff --git a/service/test/adapter/mail_service_test.py b/service/test/adapter/mail_service_test.py index 225c08f8..04fbeb82 100644 --- a/service/test/adapter/mail_service_test.py +++ b/service/test/adapter/mail_service_test.py @@ -78,7 +78,6 @@ class TestMailService(unittest.TestCase): self.assertEqual(1, len(mails)) self.assertEqual(set([Tag('custom_tag')]), mails[0].tags) - def test_send_mail(self): leap_session = Mock(account_email=lambda: "username@leap_server") mail_service = MailService(leap_session) @@ -94,5 +93,3 @@ class TestMailService(unittest.TestCase): mail_service.send(mail) mail_service.smtp_client.sendmail.assert_called_with('username@leap_server', 'to@pixelated.org', "mail as string") - - diff --git a/service/test/adapter/pixelated_mail_test.py b/service/test/adapter/pixelated_mail_test.py index 7dfdc6d9..8c1d5896 100644 --- a/service/test/adapter/pixelated_mail_test.py +++ b/service/test/adapter/pixelated_mail_test.py @@ -91,4 +91,3 @@ class TestPixelatedMail(unittest.TestCase): smtp_format = mail.to_smtp_format(_from='pixelated@org') self.assertRegexpMatches(smtp_format, "\nFrom: pixelated@org") - |