mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #903 from dominiqueplante/readers.read_file-throwsexception
Add unit test for the case for handing unhandled extension
This commit is contained in:
commit
2be674c909
2 changed files with 23 additions and 0 deletions
|
|
@ -14,6 +14,17 @@ CONTENT_PATH = os.path.join(CUR_DIR, 'content')
|
|||
def _path(*args):
|
||||
return os.path.join(CONTENT_PATH, *args)
|
||||
|
||||
class ReaderTests(unittest.TestCase):
|
||||
def test_readfile_unknown_extension(self):
|
||||
f = _path('article_with_metadata.unknownextension')
|
||||
with self.assertRaises(TypeError) as cm:
|
||||
readers.read_file(f)
|
||||
ex = cm.exception
|
||||
self.assertEqual('Pelican does not know how to parse ' + f, ex.message)
|
||||
#, setattr, root.c1.c2, 'text', "test")
|
||||
# self.assertTrue(1 == 0)
|
||||
# except TypeError:
|
||||
# self.assertTrue(1 == 1)
|
||||
|
||||
class ReaderTest(unittest.TestCase):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue