Browse Source

add test for custom contents

pull/235/head
Oliverpool 8 years ago
parent
commit
d45753b5bc
  1. 1
      test/test_content/customzipped.control
  2. 4
      test/test_content/customzipped.source
  3. 15
      test/test_content/datadir/python/content/customzipedplugin.py
  4. BIN
      test/test_content/datadir_zippedcontent/python/content
  5. 2
      test/test_content/test_content.py

1
test/test_content/customzipped.control

@ -0,0 +1 @@
- "{'customzippedname:': ''}"

4
test/test_content/customzipped.source

@ -0,0 +1,4 @@
- addsongdir:
path: "datadir_sort"
content:
- customzippedname:

15
test/test_content/datadir/python/content/customzipedplugin.py

@ -0,0 +1,15 @@
"""Fake plugin for test purposes."""
from patacrep.content import ContentItem, ContentList, validate_parser_argument
class FakeContent(ContentItem):
"""Fake content."""
def file_entry(self):
return {'customzippedname:':''}
def parse(keyword, argument, config):
return ContentList([FakeContent()])
CONTENT_PLUGINS = {'customzipedname': parse}

BIN
test/test_content/datadir_zippedcontent/python/content

Binary file not shown.

2
test/test_content/test_content.py

@ -101,7 +101,7 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest):
# Load the default songbook config
config = prepare_songbook(
{'book':{'datadir':'datadir'}, 'content': sbcontent},
{'book':{'datadir':['datadir', 'datadir_zippedcontent']}, 'content': sbcontent},
outputdir,
base,
outputdir

Loading…
Cancel
Save