Ejemplo n.º 1
0
def test_ranking_network_simplest_path_from_simple_ranking_graph():
    rg = simple_graph()

    test = RankingNetwork()
    test.build_from_ranking_graph(rg)
    result = test.simplest_complete_paths("a", "c")

    assert (result == [["a", "b", "c"]])
Ejemplo n.º 2
0
def test_ranking_network_simplest_path_from_ranking_graph():
    rg = tea_graph()

    test = RankingNetwork(rg)
    test.build_from_ranking_graph(rg)
    result = test.simplest_complete_paths("Boil_water_in_the_kettle",
                                          "Drink_tea")
    expected_result = [[
        'Boil_water_in_the_kettle', 'Get_a_cup_from_the_cupboard',
        'Pour_boiled_water_into_cup', 'Put_tea_bag_into_cup', 'Drink_tea'
    ],
                       [
                           'Boil_water_in_the_kettle',
                           'Get_a_cup_from_the_cupboard',
                           'Put_tea_bag_into_cup',
                           'Pour_boiled_water_into_cup', 'Drink_tea'
                       ]]

    assert (result == expected_result)