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