def METHOD_NAME(
    mock_module_filename, mock_package_perms, mock_packages, config
):
    spec = spack.spec.Spec("mpileaks").concretized()
    # The code tested is common to all module types, but has to be tested from
    # one. Tcl picked at random
    generator = spack.modules.tcl.TclModulefileWriter(spec, "default")
    generator.write()
    assert mock_package_perms & os.stat(mock_module_filename).st_mode == mock_package_perms