From e0cd19256171b18eee571808f7fc12cd042faf19 Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Thu, 11 Sep 2014 11:24:47 -0300 Subject: Fixing functional tests (py fake has to work with both csv mailset or old mailset) --- py-fake-service/app/adapter/contacts.py | 2 +- py-fake-service/app/adapter/mail.py | 2 +- py-fake-service/app/pixelated_user_agent.py | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'py-fake-service/app') diff --git a/py-fake-service/app/adapter/contacts.py b/py-fake-service/app/adapter/contacts.py index f241de98..30ff1253 100644 --- a/py-fake-service/app/adapter/contacts.py +++ b/py-fake-service/app/adapter/contacts.py @@ -22,7 +22,7 @@ class Contacts: self.contacts = [] def add(self, mbox_mail): - contact = mbox_mail.get('From') + contact = mbox_mail.get('From') or mbox_mail.from_addr self.contacts.append(Contact(contact)) def search(self, query): diff --git a/py-fake-service/app/adapter/mail.py b/py-fake-service/app/adapter/mail.py index a18f6276..5a298385 100644 --- a/py-fake-service/app/adapter/mail.py +++ b/py-fake-service/app/adapter/mail.py @@ -71,7 +71,7 @@ class Mail: def _get_headers(self, mbox_mail): headers = {} - headers['from'] = mbox_mail.get('From') + headers['from'] = mbox_mail.get('From') or mbox_mail.from_addr headers['to'] = [mbox_mail.get('To')] headers['subject'] = mbox_mail.get('Subject') headers['date'] = datetime.fromtimestamp( diff --git a/py-fake-service/app/pixelated_user_agent.py b/py-fake-service/app/pixelated_user_agent.py index c500dd08..9b5d1e4e 100644 --- a/py-fake-service/app/pixelated_user_agent.py +++ b/py-fake-service/app/pixelated_user_agent.py @@ -1,5 +1,4 @@ -# -# Copyright (c) 2014 ThoughtWorks, Inc. +# # Copyright (c) 2014 ThoughtWorks, Inc. # # Pixelated is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -28,7 +27,7 @@ MEDIUM_TAGGED_URL = 'https://static.wazokazi.is/py-mediumtagged.tar.gz' client = None converter = None account = None -loaded = True +loaded = False mail_service = MailService() -- cgit v1.2.3