From d6e632de0afaf3db96588ae08dc9f2757a5dfa44 Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Tue, 21 Jul 2015 09:12:24 +0000 Subject: Fixed relative file resource in test_mail.py. --- service/test/unit/adapter/test_mail.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'service') diff --git a/service/test/unit/adapter/test_mail.py b/service/test/unit/adapter/test_mail.py index f73ef333..2b512313 100644 --- a/service/test/unit/adapter/test_mail.py +++ b/service/test/unit/adapter/test_mail.py @@ -26,6 +26,7 @@ from leap.mail.adaptors import soledad_indexes as fields from datetime import datetime import os import json +import pkg_resources class TestPixelatedMail(unittest.TestCase): @@ -301,7 +302,7 @@ class TestPixelatedMail(unittest.TestCase): self.assertEquals(body, mail.text_plain_body) def test_bounced_mails_are_recognized(self): - bounced_mail_hdoc = os.path.join(os.path.dirname(__file__), '..', 'fixtures', 'bounced_mail_hdoc.json') + bounced_mail_hdoc = pkg_resources.resource_filename('test.unit.fixtures', 'bounced_mail_hdoc.json') with open(bounced_mail_hdoc) as f: hdoc = json.loads(f.read()) @@ -322,7 +323,7 @@ class TestPixelatedMail(unittest.TestCase): Persistent errors should start with 5. See: http://www.iana.org/assignments/smtp-enhanced-status-codes/smtp-enhanced-status-codes.xhtml """ - bounced_mail_hdoc = os.path.join(os.path.dirname(__file__), '..', 'fixtures', 'bounced_mail_hdoc.json') + bounced_mail_hdoc = pkg_resources.resource_filename('test.unit.fixtures', 'bounced_mail_hdoc.json') with open(bounced_mail_hdoc) as f: content = f.read() # Change status to 4.XXX.YYY (only the first number is relevant here) -- cgit v1.2.3