def METHOD_NAME():
    """
    test that we can set permanent environment variables (requires pywin32)
    """
    with patch.dict(
        envmodule.__utils__,
        {
            "reg.set_value": MagicMock(),
            "reg.delete_value": MagicMock(),
            "win_functions.broadcast_setting_change": MagicMock(),
        },
    ):
        ret = envstate.setenv("test", "value", permanent=True)
        assert ret["changes"] == {"test": "value"}
        envmodule.__utils__["reg.set_value"].assert_called_with(
            "HKCU", "Environment", "test", "value"
        )
        ret = envstate.setenv("test", False, false_unsets=True, permanent=True)
        assert ret["changes"] == {"test": None}
        envmodule.__utils__["reg.delete_value"].assert_called_with(
            "HKCU", "Environment", "test"
        )