

@istest
def builds_items_list_after_recursing_over_a_dict(self):

    def foo_macher(item):
        return ('foo' in item)
    found_items = []
    collection = {
        'my name': 'foo name',
        'personal stuff': {
            'car': 'some foo truck',
            'books': ['foo', 'bar'],
            'bar': 'something with iron, just ignore',
            'others': {
                'foo': 'something undescribable',
            },
        },
    }
    recurse_items(collection, foo_macher, found_items)
    expected_items = ['foo name', 'some foo truck', ['foo', 'bar'], {
        'foo': 'something undescribable',
    }]
    self.assertListEqual(sorted(found_items), sorted(expected_items), found_items)

dataset/ETHPy150Open python-provy/provy/tests/unit/core/test_runner.py RunnerTest.builds_items_list_after_recursing_over_a_dict/original