@pytest.mark.parametrize('params,expected_paths', [({'some': lf('one'), 'one': lf('three')}, ['one>some']), ({'grand1': lf('parent1_1'), 'parent1_1': lf('child1'), 'grand2': lf('parent1_2'), 'parent1_2': lf('child1'), 'child1': lf('none')}, ['child1>parent1_1>grand1>parent1_2>grand2', 'child1>parent1_2>grand2>parent1_1>grand1']), ({'param1': 'val1', 'param2': 'val2'}, ['param1>param2', 'param2>param1']), ({}, ['']), ({'param1': 'val1'}, ['param1']), ({'param1': lf('some')}, ['param1']), ({'one': 1, 'as_str': lf('one'), 'as_hex': lf('one')}, ['one>as_str>as_hex', 'one>as_hex>as_str'])])
def test_sorted_by_dependency(params, expected_paths):
    sp = sorted_by_dependency(params, [])
    path = '>'.join((param for (param, _) in sp))
    assert (path in expected_paths)
@pytest.mark.parametrize('params,expected_paths', [({'some': lf('one'), 'one': lf('three')}, ['one>some']), ({'grand1': lf('parent1_1'), 'parent1_1': lf('child1'), 'grand2': lf('parent1_2'), 'parent1_2': lf('child1'), 'child1': lf('none')}, ['child1>parent1_1>grand1>parent1_2>grand2', 'child1>parent1_2>grand2>parent1_1>grand1']), ({'param1': 'val1', 'param2': 'val2'}, ['param1>param2', 'param2>param1']), ({}, []), ({'param1': 'val1'}, ['param1']), ({'param1': lf('some')}, ['param1']), ({'one': 1, 'as_str': lf('one'), 'as_hex': lf('one')}, ['one>as_str>as_hex', 'one>as_hex>as_str'])])
def test_sorted_by_dependency(params, expected_paths):
    sp = sorted_by_dependency(params, [])
    path = '>'.join((param for (param, _) in sp))
    assert (path in expected_paths)