Esempio n. 1
0
class testBTApp(unittest.TestCase):
    """Tests the BTApp which is the main control point for using AutonomoTorrent
    """
    def setUp(self):
        self.bt_app = BTApp() 

    def test_using_file(self):
        """Tests the BT App using a known good torrent meta file from disk.
        """
        config = BTConfig(torrent_path="tests/unit/damn_small_linux.torrent")
        self.bt_app.add_torrent(config)
        reactor.callLater(2.5, reactor.stop)
        self.bt_app.start_reactor()
Esempio n. 2
0
def main(opt, btfiles):
    app = BTApp(save_dir=opt.save_dir, 
                listen_port=opt.listen_port, 
                enable_DHT=opt.enable_dht,
                remote_debugging=opt.remote_debugging)
    for torrent_file in btfiles:
        try:
            log.msg('Adding: {0}'.format(torrent_file))
            config = BTConfig(torrent_file)
            config.downloadList = None
            app.add_torrent(config)

        except:
            log.err()
            log.err("Failed to add {0}".format(torrent_file))

    app.start_reactor()