Beispiel #1
0
    def rmttest_positive_01(self):
        "Two node one edge digraph B -> A"
        config, reqset = create_parameters({"B": ["A"], "A": []})
        reqset.graph_master_node = reqset.find("A")

        rdep = RDepNoDirectedCircles(config)
        result = rdep.rewrite(reqset)

        assert result
Beispiel #2
0
    def rmttest_positive_01(self):
        "Two node one edge digraph B -> A"
        config, reqset = create_parameters({"B": ["A"], "A": []})
        reqset.graph_master_node = reqset.find("A")

        rdep = RDepNoDirectedCircles(config)
        result = rdep.rewrite(reqset)

        assert result
Beispiel #3
0
    def rmttest_negative_01(self):
        "small digraph D -> B -> A and A -> C -> D"
        config, reqset = create_parameters(
            {"D": ["B"], "C": ["D"], "B": ["A"], "A": ["C"]})
        reqset.graph_master_node = reqset.find("A")

        rdep = RDepNoDirectedCircles(config)
        result = rdep.rewrite(reqset)

        assert not result
Beispiel #4
0
    def test_positive_01(self):
        "small digraph D -> B -> A and D -> C -> A"
        config, reqset = create_parameters(
            {"D": ["B", "C"], "C": ["A"], "B": ["A"], "A": [] })
        reqset.graph_master_node = reqset.find("A")

        rdep = RDepNoDirectedCircles(config)
        result = rdep.rewrite(reqset)

        assert(result == True)
Beispiel #5
0
    def rmttest_negative_01(self):
        "small digraph D -> B -> A and A -> C -> D"
        config, reqset = create_parameters({
            "D": ["B"],
            "C": ["D"],
            "B": ["A"],
            "A": ["C"]
        })
        reqset.graph_master_node = reqset.find("A")

        rdep = RDepNoDirectedCircles(config)
        result = rdep.rewrite(reqset)

        assert not result
Beispiel #6
0
    def rmttest_positive_02(self):
        "small digraph D -> B -> A and D -> C -> A"
        config, reqset = create_parameters({
            "D": ["B", "C"],
            "C": ["A"],
            "B": ["A"],
            "A": []
        })
        reqset.graph_master_node = reqset.find("A")

        rdep = RDepNoDirectedCircles(config)
        result = rdep.rewrite(reqset)

        self.assertTrue(result)