mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-22 22:32:23 +00:00
test_web: improve test coverage of PUT DIRURL t=uri replace=false
This commit is contained in:
parent
a5aebf0cbd
commit
0350994133
@ -2178,6 +2178,25 @@ class Web(WebMixin, testutil.StallMixin, unittest.TestCase):
|
|||||||
d.addCallback(_made_dir)
|
d.addCallback(_made_dir)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
def test_PUT_DIRURL_uri_noreplace(self):
|
||||||
|
d = self.s.create_empty_dirnode()
|
||||||
|
def _made_dir(dn):
|
||||||
|
new_uri = dn.get_uri()
|
||||||
|
# replace /foo with a new (empty) directory, but ask that
|
||||||
|
# replace=false, so it should fail
|
||||||
|
d = self.shouldFail2(error.Error, "test_PUT_DIRURL_uri_noreplace",
|
||||||
|
"409 Conflict", "There was already a child by that name, and you asked me to not replace it",
|
||||||
|
self.PUT,
|
||||||
|
self.public_url + "/foo?t=uri&replace=false",
|
||||||
|
new_uri)
|
||||||
|
d.addCallback(lambda res:
|
||||||
|
self.failUnlessChildURIIs(self.public_root,
|
||||||
|
u"foo",
|
||||||
|
self._foo_uri))
|
||||||
|
return d
|
||||||
|
d.addCallback(_made_dir)
|
||||||
|
return d
|
||||||
|
|
||||||
def test_PUT_NEWFILEURL_uri(self):
|
def test_PUT_NEWFILEURL_uri(self):
|
||||||
contents, n, new_uri = self.makefile(8)
|
contents, n, new_uri = self.makefile(8)
|
||||||
d = self.PUT(self.public_url + "/foo/new.txt?t=uri", new_uri)
|
d = self.PUT(self.public_url + "/foo/new.txt?t=uri", new_uri)
|
||||||
|
Loading…
Reference in New Issue
Block a user