add failing test for issue #5

We do not need to see the output of that feed, actually: we just want
to parse it. Therefore, make sure we can test any .xml file provided
even if it does not have a matching .mbx.

It is a little strange we test parsing of all feeds in the mbx plugin,
but since we do it anyways, I don't see why it should be moved out of
parent 63f75c6b
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<title>RSS Feed</title>
<description>Generated from iCal</description>
<title>The amACEing RACE</title>
<description>Sign-up required! There are roughly 22 of 24 places left. Moreinformation:</description>
<guid isPermaLink="false"></guid>
<title>Active Member Activity</title>
<description>Sign-up required! There are roughly 45 of 60 places left. Moreinformation:</description>
<guid isPermaLink="false"></guid>
<title>E3 Viewing Party</title>
<description>Sign-up required, but no participant limit. More information:</description>
<guid isPermaLink="false"></guid>
<title>[External] Kick 'EM master mentor interest drink</title>
<description>No sign-up necessary. This activity is not organised by S.A.Proto More information:</description>
<guid isPermaLink="false"></guid>
......@@ -132,13 +132,19 @@ def test_email(tmpdir, feed_manager, static_boundary, betamax): # noqa
'filter_args': 'Trump'})
body = betamax.get(feed['url']).content
feed_manager.dispatch(feed, feed.parse(body), lock=LOCK)
p = path[:-3] + 'mbx'
with open(p) as expected:
folder = utils.slug(feed['name']) + '.mbx'
r = re.compile('User-Agent: .*$', flags=re.MULTILINE)
actual = r.sub('', tmpdir.join('Mail', folder).read())
expect = r.sub('',
assert actual
folder = utils.slug(feed['name']) + '.mbx'
ua_pattern = re.compile('User-Agent: .*$', flags=re.MULTILINE)
actual = ua_pattern.sub('', tmpdir.join('Mail', folder).read())
assert actual
mbox_path = path[:-3] + 'mbx'
with open(mbox_path) as expected:
expect = ua_pattern.sub('',
except FileNotFoundError:
# ignore missing mailbox samples
assert expect == actual
assert path
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment