From 0ef62a242c8b8bb5a39dc5d4b1fc75123e9f70d8 Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Mon, 18 Aug 2014 15:15:09 -0300 Subject: Duda/Patrick: reseting py-fake-service mails before loading them again --- py-fake-service/app/adapter/mail_service.py | 5 +++++ py-fake-service/app/pixelated_user_agent.py | 1 + 2 files changed, 6 insertions(+) diff --git a/py-fake-service/app/adapter/mail_service.py b/py-fake-service/app/adapter/mail_service.py index 3da7ce59..3a4d45cc 100644 --- a/py-fake-service/app/adapter/mail_service.py +++ b/py-fake-service/app/adapter/mail_service.py @@ -15,6 +15,11 @@ class MailService: self.tagsset = TagsSet() self.contacts = Contacts() + def reset(self): + self.mailset = MailSet() + self.tagsset = TagsSet() + self.contacts = Contacts() + def load_mailset(self): mbox_filenames = [ filename diff --git a/py-fake-service/app/pixelated_user_agent.py b/py-fake-service/app/pixelated_user_agent.py index 3378bcca..7d974329 100644 --- a/py-fake-service/app/pixelated_user_agent.py +++ b/py-fake-service/app/pixelated_user_agent.py @@ -130,6 +130,7 @@ def load_mailset(mailset): tarfile = TarFile(fileobj=gzippedfile) tarfile.extractall(path=mbox_root) + mail_service.reset() mail_service.load_mailset() return respond_json(None) -- cgit v1.2.3