def test_string_composed_filter_with_spaces(): """ Test spaces in filter. """ tiddlers = [] for name in ['one', 'two', 'three']: tiddler = Tiddler('tiddler %s' % name) tiddler.text = name tiddlers.append(tiddler) found_tiddlers = list(filter('select=title:tiddler one', tiddlers)) assert len(found_tiddlers) == 1, 'one tiddler should be found, got %s' % len(found_tiddlers) assert found_tiddlers[0].title == 'tiddler one'
def test_string_composed_filter_with_spaces(): """ Test spaces in filter. """ tiddlers = [] for name in ['one', 'two', 'three']: tiddler = Tiddler('tiddler %s' % name) tiddler.text = name tiddlers.append(tiddler) found_tiddlers = list(filter('select=title:tiddler one', tiddlers)) assert len( found_tiddlers ) == 1, 'one tiddler should be found, got %s' % len(found_tiddlers) assert found_tiddlers[0].title == 'tiddler one'
def test_string_composed_filter_with_spaces(): """ Test spaces in filter. """ tiddlers = [] for name in ['one', 'two', 'three']: tiddler = Tiddler('tiddler %s' % name) tiddler.text = name tiddlers.append(tiddler) filter_string = '[[tiddler one]]' filters = filter.compose_from_string(filter_string) found_tiddlers = filter.by_composition(filters, tiddlers) assert len(found_tiddlers) == 1, 'one tiddler should be found, got %s' % len(found_tiddlers) assert found_tiddlers[0].title == 'tiddler one'