def test_post(self): c = Configuration() cs = CommandSequence() cs.command().function("func 0") cs.command().function("func 1") c.post(cs) assert "func 0" == c.to_map()["post"][0]["func"] assert 2 == len(c.to_map()["post"])
def test_invalid_post(self): c = Configuration() with pytest.raises(TypeError): c.post("hello world")