def render_POST(self, request): json_request = json.loads(request.content.read()) zip_request = ZipRequest.fromJson(json_request) deferred = zip_request.validate() deferred.addCallback(self.render_response, zip_request, request) deferred.addErrback(self.render_error, request) return NOT_DONE_YET
def test_missing_keys(self): def cb(value): self.fail() def eb(failure): return True json_obj = [ { 'bucket': 'zippy2-dev', 'keys': [ 'asdfasdfasfasdfasdfasdf', 'asdfasdfasfasfd', 'asdfsadf' ], } ] request = ZipRequest.fromJson(json_obj) deferred = request.validate() deferred.addCallback(cb) deferred.addErrback(eb) return deferred
def test_dummy_bucket_and_keys(self): json_obj = [ { 'bucket': 'zippy2-dev', 'keys': [ 'foo.bar', 'baz.bat' ], } ] request = ZipRequest.fromJson(json_obj) self.assertEquals(len(request.objects), 2)