Adding upstream version 1.0.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
5cd8ebe7c9
commit
70c11d34fc
55 changed files with 6853 additions and 0 deletions
37
tests/test_main.py
Normal file
37
tests/test_main.py
Normal file
|
@ -0,0 +1,37 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
'''
|
||||
Tests for feedgen main
|
||||
'''
|
||||
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from feedgen import __main__
|
||||
|
||||
|
||||
class TestSequenceFunctions(unittest.TestCase):
|
||||
|
||||
def test_usage(self):
|
||||
sys.argv = ['feedgen']
|
||||
with self.assertRaises(SystemExit) as e:
|
||||
__main__.main()
|
||||
self.assertEqual(e.exception.code, None)
|
||||
|
||||
def test_feed(self):
|
||||
for ftype in 'rss', 'atom', 'podcast', 'torrent', 'dc.rss', \
|
||||
'dc.atom', 'syndication.rss', 'syndication.atom':
|
||||
sys.argv = ['feedgen', ftype]
|
||||
__main__.main()
|
||||
|
||||
def test_file(self):
|
||||
for extemsion in '.atom', '.rss':
|
||||
fh, filename = tempfile.mkstemp(extemsion)
|
||||
sys.argv = ['feedgen', filename]
|
||||
try:
|
||||
__main__.main()
|
||||
finally:
|
||||
os.close(fh)
|
||||
os.remove(filename)
|
Loading…
Add table
Add a link
Reference in a new issue