From 8e0c0485e7c0fd1076291e1a07397726b46ab66e Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Tue, 12 Aug 2014 16:49:49 -0300 Subject: saving drafts in py-fake-service; --- py-fake-service/app/adapter/mail_service.py | 4 ++++ py-fake-service/app/pixelated_user_agent.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'py-fake-service') diff --git a/py-fake-service/app/adapter/mail_service.py b/py-fake-service/app/adapter/mail_service.py index 3d12feb5..815d3dc4 100644 --- a/py-fake-service/app/adapter/mail_service.py +++ b/py-fake-service/app/adapter/mail_service.py @@ -73,6 +73,10 @@ class MailService: return mail.ident + def update_draft(self, mail): + mail = Mail.from_json(mail) + self.mailset.update(mail) + return mail.ident diff --git a/py-fake-service/app/pixelated_user_agent.py b/py-fake-service/app/pixelated_user_agent.py index e0312114..2abdb5a1 100644 --- a/py-fake-service/app/pixelated_user_agent.py +++ b/py-fake-service/app/pixelated_user_agent.py @@ -36,7 +36,9 @@ def save_draft_or_send(): @app.route('/mails', methods=['PUT']) def update_draft(): - return respond_json({'ident': 123}) + mail = request.json + ident = mail_service.update_draft(mail) + return respond_json({'ident': ident}) @app.route('/mails') -- cgit v1.2.3