Пример #1
0
    def test_removing_system_presets(self):
        self.manager.load_all()
        system_presets = list(self.manager.presets.keys())
        for preset_name in system_presets:
            self.manager.restore_preset(preset_name)
            self.manager.remove_current_preset()

        # Check that the files have not been deleted or changed.
        other_manager = AudioPresetManager(System())
        other_manager.user_path = "/pitivi/non/existing/directory"
        other_manager.load_all()
        for preset_name in system_presets:
            self.assertTrue(other_manager.has_preset(preset_name))

        # Check that overwrite files have been created and
        # they mark the system presets as deleted.
        other_manager = self.create_other_manager()
        other_manager.load_all()
        for preset_name in system_presets:
            self.assertFalse(other_manager.has_preset(preset_name))
Пример #2
0
    def test_renaming_system_presets(self):
        self.manager.load_all()
        system_presets = list(self.manager.presets.keys())
        new_name_template = "%s new"
        for preset_name in system_presets:
            self.manager.restore_preset(preset_name)
            new_name = new_name_template % preset_name
            self.manager.save_current_preset(new_name)

        # Check that the files have not been deleted or changed.
        other_manager = AudioPresetManager(System())
        other_manager.user_path = "/pitivi/non/existing/directory"
        other_manager.load_all()
        for preset_name in system_presets:
            self.assertTrue(other_manager.has_preset(preset_name), preset_name)

        other_manager = self.create_other_manager()
        other_manager.load_all()
        for preset_name in system_presets:
            self.assertFalse(other_manager.has_preset(preset_name),
                             preset_name)
            new_name = new_name_template % preset_name
            self.assertTrue(other_manager.has_preset(new_name), new_name)