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"]
def test_invalid_file(self): c = CmdExpansionsUpdate() with pytest.raises(TypeError): c.file(42)
def test_invalid_updates(self): c = CmdExpansionsUpdate() with pytest.raises(TypeError): c.updates("hello")
def test_command_basics(self): c = CmdExpansionsUpdate() c.validate() assert "expansions.update" == command_name(c)