Пример #1
0
def test_breadth_first_search():
    section = ExperimentSection(make_tree(['session', 'block', 'trial'], {}), ChainMap())
    section[1][2].data['foo'] = True

    key = lambda node: node.data.get('foo', False)
    search_result = section.breadth_first_search(key)
    assert search_result == [section, section[1], section[1][2]]

    assert section.breadth_first_search(lambda node: False) == []