diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-08-18 15:15:09 -0300 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-08-18 15:15:09 -0300 |
commit | 0ef62a242c8b8bb5a39dc5d4b1fc75123e9f70d8 (patch) | |
tree | 65267754e7c28155f5b00ebb4dbcedd8392330e2 /py-fake-service | |
parent | e2da0313caf715eef495ca3b14bd7f8af9735556 (diff) |
Duda/Patrick: reseting py-fake-service mails before loading them again
Diffstat (limited to 'py-fake-service')
-rw-r--r-- | py-fake-service/app/adapter/mail_service.py | 5 | ||||
-rw-r--r-- | py-fake-service/app/pixelated_user_agent.py | 1 |
2 files changed, 6 insertions, 0 deletions
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) |