1 | Test source section |
---|
2 | =================== |
---|
3 | |
---|
4 | >>> source = """ |
---|
5 | ... [transmogrifier] |
---|
6 | ... pipeline = |
---|
7 | ... source |
---|
8 | ... printer |
---|
9 | ... |
---|
10 | ... [source] |
---|
11 | ... blueprint = quintagroup.transmogrify.simpleblog2quills.tests.source |
---|
12 | ... source = marshall |
---|
13 | ... items = |
---|
14 | ... not-existing; Document; not-existing-path |
---|
15 | ... not-existing; File; /not/existing/absolute/path |
---|
16 | ... plone-blog; Blog; blog.xml |
---|
17 | ... |
---|
18 | ... [printer] |
---|
19 | ... blueprint = collective.transmogrifier.sections.tests.pprinter |
---|
20 | ... """ |
---|
21 | >>> registerConfig(u'quintagroup.transmogrify.simpleblog2quills.tests.source', source) |
---|
22 | >>> transmogrifier(u'quintagroup.transmogrify.simpleblog2quills.tests.source') # doctest: +ELLIPSIS, +REPORT_NDIFF |
---|
23 | {'_files': {'marshall': {'data': ...}}, |
---|
24 | '_path': 'plone-blog', |
---|
25 | '_type': 'Blog'} |
---|
26 | |
---|
27 | Now we are testing ``allow-empty-items`` option: |
---|
28 | |
---|
29 | >>> source = """ |
---|
30 | ... [transmogrifier] |
---|
31 | ... pipeline = |
---|
32 | ... source |
---|
33 | ... printer |
---|
34 | ... |
---|
35 | ... [source] |
---|
36 | ... blueprint = quintagroup.transmogrify.simpleblog2quills.tests.source |
---|
37 | ... allow-empty-items = yes |
---|
38 | ... source = marshall |
---|
39 | ... items = |
---|
40 | ... not-existing; Document; not-existing-path |
---|
41 | ... not-existing; File; /not/existing/absolute/path |
---|
42 | ... plone-blog; Blog; blog.xml |
---|
43 | ... |
---|
44 | ... [printer] |
---|
45 | ... blueprint = collective.transmogrifier.sections.tests.pprinter |
---|
46 | ... """ |
---|
47 | >>> registerConfig(u'quintagroup.transmogrify.simpleblog2quills.tests.source-with-empties', source) |
---|
48 | >>> transmogrifier(u'quintagroup.transmogrify.simpleblog2quills.tests.source-with-empties') # doctest: +ELLIPSIS, +REPORT_NDIFF |
---|
49 | {'_type': 'Document', '_path': 'not-existing'} |
---|
50 | {'_type': 'File', '_path': 'not-existing'} |
---|
51 | {'_files': {'marshall': {'data': ...}}, |
---|
52 | '_path': 'plone-blog', |
---|
53 | '_type': 'Blog'} |
---|