summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-01-29 16:18:27 -0400
committerKali Kaneko <kali@leap.se>2014-01-30 14:20:56 -0400
commit37090301e633cdf9aa0c924ea3899d4c5d4fcdb9 (patch)
tree62c9c7cfa08a63c6e841d75988bd89de2b1eccdc /src/leap
parent1b71ba510a2e6680f1ecc84eacfc492b0bbe24fc (diff)
allow to pass file as argument
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/mail/imap/tests/walktree.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/leap/mail/imap/tests/walktree.py b/src/leap/mail/imap/tests/walktree.py
index 1626f65..f3cbcb0 100644
--- a/src/leap/mail/imap/tests/walktree.py
+++ b/src/leap/mail/imap/tests/walktree.py
@@ -18,12 +18,14 @@
Tests for the walktree module.
"""
import os
+import sys
from email import parser
from leap.mail import walk as W
DEBUG = os.environ.get("BITMASK_MAIL_DEBUG")
+
p = parser.Parser()
# TODO pass an argument of the type of message
@@ -31,9 +33,17 @@ p = parser.Parser()
##################################################
# Input from hell
-#msg = p.parse(open('rfc822.multi-signed.message'))
-#msg = p.parse(open('rfc822.plain.message'))
-msg = p.parse(open('rfc822.multi-minimal.message'))
+if len(sys.argv) > 1:
+ FILENAME = sys.argv[1]
+else:
+ FILENAME = "rfc822.multi-minimal.message"
+
+"""
+FILENAME = "rfc822.multi-signed.message"
+FILENAME = "rfc822.plain.message"
+"""
+
+msg = p.parse(open(FILENAME))
DO_CHECK = False
#################################################