def test_require_minimum_number_of_peaks_required_4_ratio_none(spectrum_in: SpectrumType): """Test if parent_mass scaling is properly ignored when not passing ratio_required.""" spectrum_in.set("parent_mass", 100) spectrum = require_minimum_number_of_peaks(spectrum_in, n_required=4) assert spectrum == spectrum_in, "Expected the spectrum to qualify because the number of peaks (4) is equal to the" \ "required number (4)."
def test_require_minimum_number_of_peaks_required_5_or_10(spectrum_in: SpectrumType): spectrum_in.set("parent_mass", 100) spectrum = require_minimum_number_of_peaks(spectrum_in, n_required=5, ratio_required=0.1) assert spectrum is None, "Did not expect the spectrum to qualify because the number of peaks (4) is less " \ "than the required number (10)."
def test_require_minimum_number_of_peaks_required_4_or_1_no_parent_mass(spectrum_in: SpectrumType): spectrum_in.set("parent_mass", None) spectrum = require_minimum_number_of_peaks(spectrum_in, n_required=4, ratio_required=0.1) assert spectrum == spectrum_in, "Expected the spectrum to qualify because the number of peaks (4) is equal to the" \ "required number (4)."