def METHOD_NAME(mock_test_repo, args, name, expected):
    """Test template creation."""
    repo, repodir = mock_test_repo
    create("--skip-editor", *args)
    filename = repo.filename_for_package_name(name)
    assert os.path.exists(filename)
    with open(filename, "r") as package_file:
        content = package_file.read()
        for entry in expected:
            assert entry in content
    black = which("black", required=False)
    if not black:
        pytest.skip("checking blackness of `spack create` output requires black")
    black("--check", "--diff", filename)