Esempio n. 1
0
 def test_retrieve_torrentfile(self):
     try:
         filename = '%s/test.torrent' % SCRIPTDIR
         file = open(filename, 'r')
         utils.post_torrentfile(self.client, filename, file)
     finally:
         file.close()
     resp = utils.get_torrentfile(self.client, '%s/test.torrent' % SCRIPTDIR)
     self.assert200(resp)
     self.assertEquals(resp.data, open(filename, 'r').read())
Esempio n. 2
0
 def test_delete_existing_torrentfile(self):
     '''Delete a torrent file from the tracker'''
     try:
         filename = '%s/test.torrent' % SCRIPTDIR
         file = open(filename, 'r')
         resp = utils.post_torrentfile(self.client, filename, file)
         log.debug('resp on post: %s' % resp)
     finally:
         file.close()
     with self.app.test_client() as c:
         resp = c.delete('torrents/test.torrent')
         log.debug('delete resp: %s' % resp)
         log.debug('delet resp data: %s' % resp.data)
         self.assert200(resp)
     resp = utils.get_torrentfile(self.client, filename)
     self.assert404(resp)
Esempio n. 3
0
 def test_delete_nonexistant_torrentfile(self):
     '''Make sure a torrentfile is actually deleted'''
     resp = utils.get_torrentfile(self.client, 'nonexistant.torrent')
     self.assert404(resp)