Ejemplo n.º 1
0
    def post(self):
        participants = db.participant_names()
        participants = "\n".join(["\t".join(r) for r in participants])

        meta_zip = InMemoryZip()
        meta_zip.append("participants.txt", participants)

        # write out zip file
        self.add_header("Content-type", "application/octet-stream")
        self.add_header("Content-Transfer-Encoding", "binary")
        self.add_header("Accept-Ranges", "bytes")
        self.add_header("Content-Encoding", "none")
        self.add_header("Content-Disposition", "attachment; filename=participants.zip")
        self.write(meta_zip.write_to_buffer())
        self.flush()
        self.finish()
Ejemplo n.º 2
0
    def post(self):
        participants = db.participant_names()
        participants = '\n'.join(['\t'.join(r) for r in participants])

        meta_zip = InMemoryZip()
        meta_zip.append('participants.txt', participants)

        # write out zip file
        self.add_header('Content-type', 'application/octet-stream')
        self.add_header('Content-Transfer-Encoding', 'binary')
        self.add_header('Accept-Ranges', 'bytes')
        self.add_header('Content-Encoding', 'none')
        self.add_header('Content-Disposition',
                        'attachment; filename=participants.zip')
        self.write(meta_zip.write_to_buffer())
        self.flush()
        self.finish()
Ejemplo n.º 3
0
    def post(self):
        participants = db.participant_names()
        participants = '\n'.join(['\t'.join(r) for r in participants])

        meta_zip = InMemoryZip()
        meta_zip.append('participants.txt', participants)

        # write out zip file
        self.add_header('Content-type',  'application/octet-stream')
        self.add_header('Content-Transfer-Encoding', 'binary')
        self.add_header('Accept-Ranges', 'bytes')
        self.add_header('Content-Encoding', 'none')
        self.add_header('Content-Disposition',
                        'attachment; filename=participants.zip')
        self.write(meta_zip.write_to_buffer())
        self.flush()
        self.finish()
Ejemplo n.º 4
0
 def test_participant_names(self):
     obs = db.participant_names()
     self.assertTrue(len(obs) >= 8237)
     self.assertIn('000027561', map(lambda x: x[0], obs))
Ejemplo n.º 5
0
 def test_participant_names(self):
     obs = db.participant_names()
     self.assertEqual(len(obs), 8237)
     self.assertEqual(obs[0], ["000027561", "REMOVED-0"])
Ejemplo n.º 6
0
 def test_participant_names(self):
     obs = db.participant_names()
     self.assertEqual(len(obs), 8237)
     self.assertEqual(obs[0], ['000027561', 'REMOVED-0'])
Ejemplo n.º 7
0
 def test_participant_names(self):
     obs = db.participant_names()
     self.assertTrue(len(obs) >= 8237)
     self.assertIn('000027561', map(lambda x: x[0], obs))