diff --git a/test/test_content/custom.control b/test/test_content/custom.control new file mode 100644 index 00000000..b549c6a3 --- /dev/null +++ b/test/test_content/custom.control @@ -0,0 +1 @@ +- "{'customname:': ''}" \ No newline at end of file diff --git a/test/test_content/custom.source b/test/test_content/custom.source new file mode 100644 index 00000000..ded39db8 --- /dev/null +++ b/test/test_content/custom.source @@ -0,0 +1 @@ +- customname: \ No newline at end of file diff --git a/test/test_content/datadir/python/content/customplugin.py b/test/test_content/datadir/python/content/customplugin.py new file mode 100755 index 00000000..2137198c --- /dev/null +++ b/test/test_content/datadir/python/content/customplugin.py @@ -0,0 +1,21 @@ +"""Fake plugin for test purposes.""" + +from patacrep.content import ContentItem, ContentList, validate_parser_argument + +class FakeContent(ContentItem): + """Fake content.""" + + def render(self, __context): + return 'fakecontent' + + def file_entry(self): + return {'customname:':''} + +#pylint: disable=unused-argument +def parse(keyword, argument, config): + """ + """ + return ContentList([FakeContent()]) + +CONTENT_PLUGINS = {'customname': parse} + diff --git a/test/test_content/test_content.py b/test/test_content/test_content.py index 770d4e1a..bd429bf8 100644 --- a/test/test_content/test_content.py +++ b/test/test_content/test_content.py @@ -93,7 +93,7 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): return files.path2posix(elem.filename) else: - raise Exception(elem) + return str(elem.file_entry()) @classmethod def _generate_config(cls, sbcontent, outputdir, base):