def test_branch_order(): branch_order_map = { (0, 11): 0, (11, 111, 1111): 1, (1111, 11111): 2, (1111, 11112): 2, (1111, 11113): 2, (11, 112): 1, (0, 12): 0, (12, 121, 1211): 1, (1211, 12111): 2, (1211, 12112): 2, (12, 122): 1 } for sec in tr.isection(MOCK_TREE): nt.assert_equal(branch_order(sec), branch_order_map[tuple(p for p in tr.val_iter(sec))])
def branch_order(s): '''Get the branch order of a section''' return mt.branch_order(s)