From: Brian Warner Date: Sat, 14 Jul 2007 05:19:16 +0000 (-0700) Subject: webish.py: test that _get_or_create_directories fix I made a few hours ago X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/provisioning?a=commitdiff_plain;h=6e1ad64c9d0269c7abebd61f4d8113a97743dbe0;p=tahoe-lafs%2Ftahoe-lafs.git webish.py: test that _get_or_create_directories fix I made a few hours ago --- 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: