コード例 #1
0
def test_dfs_min_depth():
    nets = ['a', 'b', 'c']

    res_plan = bs.dfs(1, nets)
    expected_plan = [
        (), ('a',), ('b',), ('c',)
    ]

    assert (res_plan == expected_plan)
コード例 #2
0
def test_dfs_short():
    nets = ['a', 'b']

    res_plan = bs.dfs(2, nets)
    expected_plan = [
        (), ('a',), ('a', 'b'), ('b',)
    ]

    assert (res_plan == expected_plan)
コード例 #3
0
def test_dfs_higher_depth():
    nets = ['a', 'b', 'c']

    res_plan = bs.dfs(33, nets)
    expected_plan = [
        (),
        ('a',), ('a', 'b'), ('a', 'b', 'c'), ('a', 'c'),
        ('b',), ('b', 'c'), ('c',)
    ]

    assert(res_plan == expected_plan)
コード例 #4
0
def test_dfs():
    nets = ['a', 'b', 'c', 'd']

    res_plan = bs.dfs(3, nets)
    expected_plan = [
        (),
        ('a', ), ('a', 'b'), ('a', 'b', 'c'), ('a', 'b', 'd'),
        ('a', 'c'), ('a', 'c', 'd'), ('a', 'd'),
        ('b', ), ('b', 'c'), ('b', 'c', 'd'), ('b', 'd'),
        ('c', ), ('c', 'd'),  ('d', )
    ]

    assert(res_plan == expected_plan)