Get testcase file and write it to the handler.
(self)
| 49 | |
| 50 | |
| 51 | def get(self): |
| 52 | """Get testcase file and write it to the handler.""" |
| 53 | testcase_id = request.get('id') |
| 54 | testcase = access.check_access_and_get_testcase(testcase_id) |
| 55 | |
| 56 | blob_info, _ = get_testcase_blob_info(testcase) |
| 57 | |
| 58 | save_as_filename = 'testcase-%s-%s' % ( |
| 59 | testcase.key.id(), blob_info.filename[-PREVIEW_BLOB_FILENAME_LENTGH:]) |
| 60 | |
| 61 | content_disposition = str('attachment; filename=%s' % save_as_filename) |
| 62 | return self.serve_gcs_object(blob_info.bucket, blob_info.object_path, |
| 63 | content_disposition) |
| 64 | |
| 65 | |
| 66 | class Handler(base_handler.Handler, gcs.SignedGcsHandler): |
no test coverage detected