def METHOD_NAME(tmp_path):
    """
    Tests the input validation for creating a Layer with either the linear
    stopping power or the mass stopping power.
    """
    aluminum_path = get_file("NIST_PSTAR_aluminum.txt", directory=tmp_path)
    arr = np.loadtxt(aluminum_path, skiprows=8)
    eaxis = arr[:, 0] * u.MeV
    mass_stopping_power = arr[:, 1] * u.MeV * u.cm**2 / u.g
    mass_density = 2.7 * u.g / u.cm**3
    # No error should be raised initializing one of these ways
    Layer(100 * u.um, eaxis, mass_stopping_power * mass_density)
    Layer(100 * u.um, eaxis, mass_stopping_power, mass_density=mass_density)
    # Error should be raised if the wrong units are provided
    with pytest.raises(ValueError):
        Layer(100 * u.um, eaxis, mass_stopping_power.value * u.kg)
    with pytest.raises(ValueError):
        Layer(
            100 * u.um,
            eaxis,
            mass_stopping_power,
            mass_density=mass_density.value * u.m,
        )
    # Error should be raised if mass_density keyword is not provided when
    # the mass stopping power is given
    with pytest.raises(ValueError):
        Layer(100 * u.um, eaxis, mass_stopping_power, mass_density=None)