Beispiel #1
0
 def test_create_torrent_two_files(self):
     file_path_list = [
         self.TORRENT_DATA_DIR / self.FILE1_NAME,
         self.TORRENT_DATA_DIR / self.FILE2_NAME
     ]
     result = create_torrent_file(file_path_list, self.get_params())
     self.assertTrue(result["success"])
Beispiel #2
0
 def save(self, torrent_filepath=None):
     """
     Generate the metainfo and save the torrent file.
     :param torrent_filepath: An optional absolute path to where to save the generated .torrent file.
     """
     torrent_dict = create_torrent_file(self.files_list, self.torrent_parameters, torrent_filepath=torrent_filepath)
     self.metainfo = bdecode_compat(torrent_dict['metainfo'])
     self.copy_metainfo_to_torrent_parameters()
     self.infohash = torrent_dict['infohash']
Beispiel #3
0
 def test_create_torrent_with_nodes(self):
     params = self.get_params()
     params["nodes"] = [("127.0.0.1", 1234)]
     result = create_torrent_file([self.TORRENT_DATA_DIR / self.FILE1_NAME],
                                  params)
     self.verify_created_torrent(result)
Beispiel #4
0
 def test_create_torrent_one_file_2(self):
     result = create_torrent_file([self.TORRENT_DATA_DIR / self.FILE2_NAME],
                                  {})
     self.verify_created_torrent(result)
Beispiel #5
0
 def test_create_torrent_one_file(self):
     result = create_torrent_file([self.TORRENT_DATA_DIR / self.FILE1_NAME],
                                  self.get_params())
     self.verify_created_torrent(result)
Beispiel #6
0
def test_create_torrent_two_files():
    file_path_list = [
        TORRENT_DATA_DIR / FILE1_NAME, TORRENT_DATA_DIR / FILE2_NAME
    ]
    result = create_torrent_file(file_path_list, get_params())
    assert result["success"]
Beispiel #7
0
def test_create_torrent_one_file_2():
    result = create_torrent_file([TORRENT_DATA_DIR / FILE2_NAME], {})
    verify_created_torrent(result)
Beispiel #8
0
def test_create_torrent_one_file():
    result = create_torrent_file([TORRENT_DATA_DIR / FILE1_NAME], get_params())
    verify_created_torrent(result)