def test_safe_bad_filename(self): resp = reusables.safe_filename( "<\">ThatsNotaFileName.\0ThatsASpaceShip^&*") assert not [x for x in ("\"", "?", "\0", "<", ">", "*") if x in resp ], resp assert reusables.check_filename(resp)
def test_check_good_filename(self): resp = reusables.check_filename("safeFile.text") assert resp
def test_check_bad_filename(self): resp = reusables.check_filename("safeFile?.text") assert not resp
def test_safe_bad_filename(self): resp = reusables.safe_filename("<\">ThatsNotaFileName.\0ThatsASpaceShip^&*") assert not [x for x in ("\"", "?", "\0", "<", ">", "*") if x in resp], resp assert reusables.check_filename(resp)