Grotti 3.0 Phase 1: Migrationen, Pool, Queue- und Abzug-Fixes.
Nummerierte SQL-Migrationen, psycopg-Pool, waitress, hängende Queue-Jobs, sichere History-Abzüge, Chargen-Locks, Upload-/Host-Validierung, ProxyFix.
This commit is contained in:
1 parent
9e22cebb81
commit
0236278929
19 files changed
+986
-81
No files matched your search
@@ -0,0 +1,21 @@
|
||||
"""Pfad- und Dateiname-Grenzen."""
|
||||
|
||||
import unittest
|
||||
|
||||
from grotti import library
|
||||
from grotti.errors import GrottiError
|
||||
|
||||
|
||||
class SafeFilenameTests(unittest.TestCase):
|
||||
def test_rejects_dotdot(self):
|
||||
self.assertEqual(library.safe_filename(".."), "datei.gcode")
|
||||
self.assertEqual(library.safe_filename("../x.gcode"), "x.gcode")
|
||||
|
||||
def test_normalize_folder_blocks_escape(self):
|
||||
with self.assertRaises(GrottiError):
|
||||
library.normalize_folder("../secret")
|
||||
self.assertEqual(library.normalize_folder("Gridfinity/A"), "Gridfinity/A")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user