Example #1
0
 async def test_add_torrent_by_hash(self):
     self.daemon.response = rsrc.response_success(
         {'torrent-added': { 'id': 1,
                             'name': rsrc.TORRENTHASH,
                             'hashString': rsrc.TORRENTHASH}}
     )
     response = await self.api.add(rsrc.TORRENTHASH)
     self.assertEqual(response.success, True)
     self.assertEqual(response.torrent, Torrent({'id': 1, 'name': rsrc.TORRENTHASH}))
Example #2
0
 async def test_add_torrent_by_local_file(self):
     self.daemon.response = rsrc.response_success({
         'torrent-added': {
             'id': 1,
             'name': 'Test Torrent',
             'hashString': rsrc.TORRENTHASH
         }
     })
     response = await self.api.add(rsrc.TORRENTFILE)
     self.assertEqual(response.success, True)
     self.assertEqual(response.torrent,
                      Torrent({
                          'id': 1,
                          'name': 'Test Torrent'
                      }))
     self.assertEqual(response.msgs, ('Added Test Torrent', ))
     self.assertEqual(response.errors, ())