Beispiel #1
0
def test_flatten_dict(tmpdir):
    d = {'1': 1, '_': {'2': 2, '_': {'3': 3, '4': 4}}}

    expected = {
        '1': 1,
        '2': 2,
        '3': 3,
        '4': 4,
    }

    assert flatten_dict(d) == expected
def test_flatten_dict(tmpdir):
    d = {"1": 1, "_": {"2": 2, "_": {"3": 3, "4": 4}}}

    expected = {"1": 1, "2": 2, "3": 3, "4": 4}

    assert flatten_dict(d) == expected