summaryrefslogtreecommitdiff
path: root/src/mailman/rules/tests/test_dmarc.py
diff options
context:
space:
mode:
authorMark Sapiro2016-12-31 14:24:32 -0800
committerMark Sapiro2016-12-31 14:24:32 -0800
commitc786a77c3b82932facd63fabe3144f9099f1ea51 (patch)
tree34ef73883abefc575e3072658babe4e01b3a6c4f /src/mailman/rules/tests/test_dmarc.py
parent4fb6712f7519ff64d142a51779a40a1eb226cbe4 (diff)
downloadmailman-c786a77c3b82932facd63fabe3144f9099f1ea51.tar.gz
mailman-c786a77c3b82932facd63fabe3144f9099f1ea51.tar.zst
mailman-c786a77c3b82932facd63fabe3144f9099f1ea51.zip
Diffstat (limited to 'src/mailman/rules/tests/test_dmarc.py')
-rw-r--r--src/mailman/rules/tests/test_dmarc.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mailman/rules/tests/test_dmarc.py b/src/mailman/rules/tests/test_dmarc.py
index e24fa29d0..9af3e9347 100644
--- a/src/mailman/rules/tests/test_dmarc.py
+++ b/src/mailman/rules/tests/test_dmarc.py
@@ -18,8 +18,6 @@
"""Provides support for mocking dnspython calls from dmarc rules and some
organizational domain tests."""
-import os
-
from contextlib import ExitStack
from dns.exception import DNSException
from dns.rdatatype import TXT
@@ -30,6 +28,7 @@ from mailman.rules import dmarc
from mailman.testing.helpers import (
LogFileMark, specialized_message_from_string as mfs)
from mailman.testing.layers import ConfigLayer
+from pkg_resources import resource_filename
from public import public
from unittest import TestCase
from unittest.mock import patch
@@ -103,11 +102,8 @@ def get_org_data():
test data.
"""
def ouropen(url):
- datapath = os.path.join(
- os.path.split(dmarc.__file__)[0],
- 'data',
- 'org_domain',
- )
+ datapath = resource_filename(
+ 'mailman.rules.tests.data', 'org_domain.txt')
org_data_url = 'file:///{}'.format(datapath)
return urlopen(org_data_url)
return patch('mailman.rules.dmarc.request.urlopen', ouropen)