From 6e1ad64c9d0269c7abebd61f4d8113a97743dbe0 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 13 Jul 2007 22:19:16 -0700 Subject: [PATCH] webish.py: test that _get_or_create_directories fix I made a few hours ago --- src/allmydata/test/test_web.py | 6 +++--- src/allmydata/webish.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index c9ecfcb9..ff450d71 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -700,11 +700,11 @@ class Web(unittest.TestCase): self.touch(localdir, "three/bar.txt") self.touch(localdir, "zap.zip") - d = self.PUT("/vdrive/global/foo/newdir?t=upload&localdir=%s" + d = self.PUT("/vdrive/global/newdir?t=upload&localdir=%s" % localdir, "") def _check(res): - self.failUnless("newdir" in self._foo_node.children) - newnode = self.nodes[self._foo_node.children["newdir"]] + self.failUnless("newdir" in self.public_root.children) + newnode = self.nodes[self.public_root.children["newdir"]] self.failUnlessEqual(sorted(newnode.children.keys()), sorted(["one", "two", "three", "zap.zip"])) onenode = self.nodes[newnode.children["one"]] diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index fc7bd4b1..7e6ddac4 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -602,6 +602,7 @@ class PUTHandler(rend.Page): if localfile: d.addCallback(self._upload_localfile, localfile, name) elif localdir: + # take the last step d.addCallback(self._get_or_create_directories, self._path[-1:]) d.addCallback(self._upload_localdir, localdir) else: -- 2.45.2