def validate_input(input_spec: InputSpec): """Make sure required input directories exist Args: input_spec (InputSpec): input file specification """ assert input_spec.validate()
def test_validate_fails_missing(): df = pd.DataFrame([{ "filepath": Path("tests/test_files/full_scan_nat_rep1.mzml"), }]) inp = InputSpec(df) assert inp.validate() == False
def test_validate_fails_missing(): df = pd.DataFrame([{ "filepath": Path("missing"), "organism": "org1", "type": "f", "element": "c", "isotope": 13, "condition": "cond1", "replicate": 1, }]) inp = InputSpec(df) assert inp.validate() == False
def test_validate_fails_duplicated(): df = pd.DataFrame([ { "filepath": Path("tests/test_files/full_scan_nat_rep1.mzml"), "organism": "org1", "type": "f", "element": "c", "isotope": 13, "condition": "cond1", "replicate": 1, }, { "filepath": Path("tests/test_files/full_scan_nat_rep1.mzml"), "organism": "org1", "type": "f", "element": "c", "isotope": 13, "condition": "cond1", "replicate": 2, }, ]) inp = InputSpec(df) assert inp.validate() == False