Exemplo n.º 1
0
    def test_pre(self):
        c = Configuration()
        cs = CommandSequence()
        cs.command().function("func 0")
        cs.command().function("func 1")
        c.pre(cs)

        assert "func 0" == c.to_map()["pre"][0]["func"]
        assert 2 == len(c.to_map()["pre"])
Exemplo n.º 2
0
    def test_invalid_pre(self):
        c = Configuration()

        with pytest.raises(TypeError):
            c.pre("hello world")