1
# -*- coding: utf-8 -*-
3
# Copyright (C) 2005-2008,2010 Osmo Salomaa
5
# This file is part of Gaupol.
7
# Gaupol is free software: you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation, either version 3 of the License, or (at your option) any later
12
# Gaupol is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License along with
17
# Gaupol. If not, see <http://www.gnu.org/licenses/>.
21
from gi.repository import Gtk
24
class _TestPositionTransformDialog(gaupol.TestCase):
30
def setup_method(self, method):
31
self.application = self.new_application()
32
page = self.application.get_current_page()
33
page.view.select_rows((1, 2, 3))
34
gaupol.conf.preview.use_custom_command = True
35
gaupol.conf.preview.custom_command = "echo"
36
page.project.video_path = self.new_subrip_file()
38
def test__init____no(self):
39
page = self.application.get_current_page()
40
page.project.video_path = None
41
page.project.main_file = None
42
page.view.select_rows(())
43
gaupol.conf.position_transform.target = gaupol.targets.SELECTED
44
self.dialog = self.dialog.__class__(self.application.window,
47
def test__on_preview_button_1_clicked(self):
48
self.dialog._current_radio.set_active(True)
49
self.dialog._preview_button_1.emit("clicked")
50
self.dialog._selected_radio.set_active(True)
51
self.dialog._preview_button_1.emit("clicked")
53
def test__on_preview_button_2_clicked(self):
54
self.dialog._current_radio.set_active(True)
55
self.dialog._preview_button_2.emit("clicked")
56
self.dialog._selected_radio.set_active(True)
57
self.dialog._preview_button_2.emit("clicked")
59
def test__on_response__current(self):
60
self.dialog._current_radio.set_active(True)
61
self.dialog.response(Gtk.ResponseType.OK)
63
def test__on_response__selected(self):
64
self.dialog._selected_radio.set_active(True)
65
self.dialog.response(Gtk.ResponseType.OK)
67
def test__on_subtitle_spin_1_value_changed(self):
68
self.dialog._subtitle_spin_1.spin(Gtk.SpinType.STEP_FORWARD, 1)
69
self.dialog._subtitle_spin_1.spin(Gtk.SpinType.STEP_FORWARD, 1)
70
self.dialog._subtitle_spin_1.spin(Gtk.SpinType.STEP_BACKWARD, 1)
71
self.dialog._subtitle_spin_1.spin(Gtk.SpinType.STEP_BACKWARD, 1)
73
def test__on_subtitle_spin_2_value_changed(self):
74
self.dialog._subtitle_spin_2.spin(Gtk.SpinType.STEP_FORWARD, 1)
75
self.dialog._subtitle_spin_2.spin(Gtk.SpinType.STEP_FORWARD, 1)
76
self.dialog._subtitle_spin_2.spin(Gtk.SpinType.STEP_BACKWARD, 1)
77
self.dialog._subtitle_spin_2.spin(Gtk.SpinType.STEP_BACKWARD, 1)
80
class TestFrameTransformDialog(_TestPositionTransformDialog):
82
def setup_method(self, method):
83
_TestPositionTransformDialog.setup_method(self, method)
84
self.dialog = gaupol.FrameTransformDialog(self.application.window,
90
class TestTimeTransformDialog(_TestPositionTransformDialog):
92
def setup_method(self, method):
93
_TestPositionTransformDialog.setup_method(self, method)
94
self.dialog = gaupol.TimeTransformDialog(self.application.window,