コード例 #1
0
    def test_params(self):
        c = CmdExpansionsUpdate()
        c.ignore_missing_file().file("file").update("k 0", "v 0").updates(
            {"k 1": "v 1", "k 2": "v 2"}
        )

        p = params(c)
        assert p["ignore_missing_file"]
        assert "file" == p["file"]
        assert "v 0" == p["updates"]["k 0"]
        assert "v 1" == p["updates"]["k 1"]
        assert "v 1" == p["updates"]["k 1"]
コード例 #2
0
    def test_invalid_file(self):
        c = CmdExpansionsUpdate()

        with pytest.raises(TypeError):
            c.file(42)
コード例 #3
0
    def test_invalid_updates(self):
        c = CmdExpansionsUpdate()

        with pytest.raises(TypeError):
            c.updates("hello")
コード例 #4
0
    def test_command_basics(self):
        c = CmdExpansionsUpdate()

        c.validate()
        assert "expansions.update" == command_name(c)