mirror of
https://github.com/9001/copyparty.git
synced 2026-09-24 19:50:25 +01:00
optimizations, failsafes, formatting
This commit is contained in:
+3
-3
@@ -107,9 +107,9 @@ class TestDots(unittest.TestCase):
|
||||
os.rename(".b", "v/.b")
|
||||
|
||||
vcfg = [
|
||||
".::r.,u1:g,u2:c,dk",
|
||||
"v/a:v/a:r.,u1:g,u2:c,dk",
|
||||
"v/.b:v/.b:r.,u1:g,u2:c,dk",
|
||||
".::r.,u1:g,u2:c,dks",
|
||||
"v/a:v/a:r.,u1:g,u2:c,dks",
|
||||
"v/.b:v/.b:r.,u1:g,u2:c,dks",
|
||||
]
|
||||
self.args = Cfg(v=vcfg, a=["u1:u1", "u2:u2"])
|
||||
self.asrv = AuthSrv(self.args, self.log)
|
||||
|
||||
@@ -26,6 +26,7 @@ def hdr(query):
|
||||
class TestHttpCli(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.td = tu.get_ramdisk()
|
||||
self.maxDiff = 99999
|
||||
|
||||
def tearDown(self):
|
||||
os.chdir(tempfile.gettempdir())
|
||||
@@ -39,6 +40,7 @@ class TestHttpCli(unittest.TestCase):
|
||||
os.mkdir(td)
|
||||
os.chdir(td)
|
||||
|
||||
# "perm+user"; r/w/a (a=rw) for user a/o/x (a=all)
|
||||
self.dtypes = ["ra", "ro", "rx", "wa", "wo", "wx", "aa", "ao", "ax"]
|
||||
self.can_read = ["ra", "ro", "aa", "ao"]
|
||||
self.can_write = ["wa", "wo", "aa", "ao"]
|
||||
@@ -121,7 +123,8 @@ class TestHttpCli(unittest.TestCase):
|
||||
|
||||
# expected files in archives
|
||||
if rok:
|
||||
ref = [x for x in vfiles if self.in_dive(top + "/" + durl, x)]
|
||||
zs = top + "/" + durl
|
||||
ref = [x for x in vfiles if self.in_dive(zs, x)]
|
||||
ref.sort()
|
||||
else:
|
||||
ref = []
|
||||
@@ -166,7 +169,7 @@ class TestHttpCli(unittest.TestCase):
|
||||
self.assertEqual([], zf_ng)
|
||||
|
||||
# stash
|
||||
h, ret = self.put(url)
|
||||
h, ret = self.put(durl)
|
||||
res = h.startswith("HTTP/1.1 201 ")
|
||||
self.assertEqual(res, wok)
|
||||
if wok:
|
||||
|
||||
@@ -267,6 +267,7 @@ class VHttpSrv(object):
|
||||
|
||||
self.u2idx = None
|
||||
self.ptn_cc = re.compile(r"[\x00-\x1f]")
|
||||
self.uparam_cc_ok = set("doc move tree".split())
|
||||
|
||||
def cachebuster(self):
|
||||
return "a"
|
||||
|
||||
Reference in New Issue
Block a user