actually returns CREATED for new data

This commit is contained in:
meejah 2020-06-12 22:08:36 -06:00
parent 776ee5f91c
commit 949b09ce27
2 changed files with 2 additions and 1 deletions

View File

@ -58,7 +58,7 @@ class FakeWebTest(TestCase):
@inlineCallbacks
def do_test():
resp = yield self.http_client.put("http://example.com/uri", content)
self.assertEqual(resp.code, 200)
self.assertEqual(resp.code, 201)
cap = yield resp.content()
self.assertTrue(cap.startswith("URI:CHK:"))

View File

@ -140,6 +140,7 @@ class _FakeTahoeUriHandler(Resource, object):
def render_PUT(self, request):
data = request.content.read()
request.setResponseCode(201) # real code does this for brand-new files
return self.add_data("URI:CHK:", data)
def render_POST(self, request):