コード例 #1
0
ファイル: test_config.py プロジェクト: dbradf/shrub.py
    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"])
コード例 #2
0
ファイル: test_config.py プロジェクト: dbradf/shrub.py
    def test_invalid_pre(self):
        c = Configuration()

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