Exemple #1
0
 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)
Exemple #2
0
 def test_check_good_filename(self):
     resp = reusables.check_filename("safeFile.text")
     assert resp
Exemple #3
0
 def test_check_bad_filename(self):
     resp = reusables.check_filename("safeFile?.text")
     assert not resp
Exemple #4
0
 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)
Exemple #5
0
 def test_check_good_filename(self):
     resp = reusables.check_filename("safeFile.text")
     assert resp
Exemple #6
0
 def test_check_bad_filename(self):
     resp = reusables.check_filename("safeFile?.text")
     assert not resp