예제 #1
0
    def test_upgrade_pstate_files(self):
        """
        Test whether the existing pstate files are correctly updated to 7.1.
        """
        os.makedirs(os.path.join(self.state_dir, STATEDIR_DLPSTATE_DIR))

        # Copy an old pstate file
        src_path = os.path.join(self.CONFIG_PATH, "download_pstate_70.state")
        shutil.copyfile(src_path, os.path.join(self.state_dir, STATEDIR_DLPSTATE_DIR, "download.state"))

        # Copy a corrupt pstate file
        src_path = os.path.join(self.CONFIG_PATH, "download_pstate_70_corrupt.state")
        corrupt_dest_path = os.path.join(self.state_dir, STATEDIR_DLPSTATE_DIR, "downloadcorrupt.state")
        shutil.copyfile(src_path, corrupt_dest_path)

        old_config = RawConfigParser()
        old_config.read(os.path.join(self.CONFIG_PATH, "tribler70.conf"))
        convert_config_to_tribler71(old_config, state_dir=self.state_dir)

        # Verify whether the section is correctly renamed
        download_config = RawConfigParser()
        download_config.read(os.path.join(self.state_dir, STATEDIR_DLPSTATE_DIR, "download.state"))
        self.assertTrue(download_config.has_section("download_defaults"))
        self.assertFalse(download_config.has_section("downloadconfig"))
        self.assertFalse(os.path.exists(corrupt_dest_path))

        # Do the upgrade again, it should not fail
        convert_config_to_tribler71(old_config, state_dir=self.state_dir)
예제 #2
0
 def upgrade_to_tribler7(self):
     """
     This method performs actions necessary to upgrade to Tribler 7.
     """
     self.session.config = convert_config_to_tribler71()
     self.session.config.set_trustchain_enabled(True)
     self.session.config.set_upgrader_enabled(False)
     self.session.config.write()
예제 #3
0
파일: upgrade.py 프로젝트: synctext/tribler
 def upgrade_to_tribler7(self):
     """
     This method performs actions necessary to upgrade to Tribler 7.
     """
     self.session.config = convert_config_to_tribler71(self.session.config)
     self.session.config.write()
예제 #4
0
 def upgrade_to_tribler7(self):
     """
     This method performs actions necessary to upgrade to Tribler 7.
     """
     self.session.config = convert_config_to_tribler71(self.session.config)
     self.session.config.write()