Ejemplo n.º 1
0
    def test_adding_commands(self):
        t = Task("task 0")
        t.commands([CmdGetProject().resolve(), CmdGetProject().resolve()])

        obj = t.to_map()
        assert 2 == len(obj["commands"])
        assert "git.get_project" == obj["commands"][0]["command"]
Ejemplo n.º 2
0
    def test_parameters(self):
        c = CmdGetProject()
        c.token("token").directory("src").revision("k 0", "v 0").revisions(
            {"k 1": "v 1", "k 2": "v 2"}
        )

        p = params(c)
        assert "token" == p["token"]
        assert "src" == p["directory"]
        assert "v 0" == p["revisions"]["k 0"]
        assert "v 1" == p["revisions"]["k 1"]
        assert "v 2" == p["revisions"]["k 2"]
Ejemplo n.º 3
0
    def test_command_basics(self):
        c = CmdGetProject()

        assert c.validate()
        assert "git.get_project" == command_name(c)