7
__all__ = ['fs', 'templates', 'stores']
9
__all__ = ['fs', 'formats', 'templates', 'stores', 'notebook']
11
def get_notebook_data(format):
12
'''Generator function for test data'''
13
assert format == 'wiki' # No other formats available for now
14
file = codecs.open('tests/notebook-wiki.txt', encoding='utf8')
18
if line.startswith('%%%%'):
19
# new page start, yield previous page
20
if not pagename is None:
21
yield (pagename, buffer)
22
pagename = line.strip('% \n')
26
yield (pagename, buffer)
28
def get_test_notebook(format='wiki'):
29
'''Returns a notebook with a memory store and some test data'''
31
store = notebook.add_store('', 'memory')
32
for name, text in get_notebook_data(format):
33
store._set_node(name, text)