aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_wlp.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_wlp.py')
-rwxr-xr-xtest/test_wlp.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/test/test_wlp.py b/test/test_wlp.py
index dcb2b78..486fb42 100755
--- a/test/test_wlp.py
+++ b/test/test_wlp.py
@@ -41,30 +41,31 @@ class TestWLP(unittest.TestCase):
class TestM2N(unittest.TestCase):
- def test_m2n(self):
- expected_output = """Newsgroups: pyg.test
+ expected_output = """Newsgroups: pyg.test
From: Pyg <pyg@localhost.com>
-To: this header probably broke RFC, but is frequent.
+To: User <user@localhost.com>
Subject: test
Date: Sun, 1 Feb 2002 16:40:40 +0200
Message-Id: <20001001164040.Aa8326@localhost>
-Content-Type: text/plain; charset=us-ascii
-Mime-Version: 1.0
Return-Path: <pyg@localhost>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
User-Agent: Mutt/1.2.5i
+X-Multiline: this header probably broke RFC, but is frequent.
X-Gateway: pyg The Python Gateway - Mail to News
"""
+
+ def test_m2n(self):
with open('examples/mail') as in_mail:
pid = subprocess.Popen(['./pygm2n', '-TV', '-n', 'pyg.test'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
out, err = pid.communicate(in_mail.read())
- self.assertEqual(out, expected_output)
+ self.assertEqual(out, self.expected_output)
class TestN2M(unittest.TestCase):
- def test_n2m(self):
- expected_output = """Received: from GATEWAY by mitmanek.ceplovi.cz with pyg
+ expected_output = """Received: from GATEWAY by mitmanek.ceplovi.cz with pyg
for <test@example.com> ; Mon Dec 15 17:13:30 2014 (CEST)
From: kame@inwind.it (PYG)
To: test@example.com
@@ -82,6 +83,8 @@ X-NNTP-Posting-Host: pyg.server.tld
Resent-From: sender@example.com
Resent-Sender: sender@example.com
"""
+
+ def test_n2m(self):
env = os.environ
env['PYTHONPATH'] = wlp_lib_path