コード例 #1
0
    def test_flat_values_in_map(self):
        cd = CommandDefinition()
        cd.function("function name").type("test").name("display name").command(
            "command name").timeout(300)

        obj = cd.to_map()
        assert "function name" == obj["func"]
        assert "test" == obj["type"]
        assert "display name" == obj["display_name"]
        assert "command name" == obj["command"]
        assert 300 == obj["timeout_secs"]
コード例 #2
0
 def test_invalid_stepback(self):
     cd = CommandDefinition()
     with pytest.raises(TypeError):
         cd.function(42)