summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2015-07-21 09:12:24 +0000
committerFolker Bernitt <fbernitt@thoughtworks.com>2015-08-11 17:00:26 +0200
commitd6e632de0afaf3db96588ae08dc9f2757a5dfa44 (patch)
tree9ea13502797f5da568bf6dc1363b9ca3cf1e6d66 /service
parentb0d46549e7bc99bac63f444ac4d225dd565b2e5d (diff)
Fixed relative file resource in test_mail.py.
Diffstat (limited to 'service')
-rw-r--r--service/test/unit/adapter/test_mail.py5
1 files changed, 3 insertions, 2 deletions
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)