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"])
def test_invalid_pre(self): c = Configuration() with pytest.raises(TypeError): c.pre("hello world")