def test_match_unit_dependents(db_conn, units_table):

    add_test_set(db_conn, units_table=units_table)
    units = Unit.list_by_entity_ids(db_conn, [
        'add', 'subtract', 'multiply', 'divide',
    ])
    deps = match_unit_dependents(units)
    assert len(deps['add']) == 3
    assert len(deps['multiply']) == 1
    assert len(deps['subtract']) == 1
    assert len(deps['divide']) == 0
Expect to order units by the number of depending units.
dataset/ETHPy150Open heiskr/sagefy/server/test/test_modules_sequencer_traversal.py/test_match_unit_dependents