[pitivi] tests: Cleanup test_clipproperties
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] tests: Cleanup test_clipproperties
- Date: Sun, 11 Feb 2018 02:03:59 +0000 (UTC)
commit 9079e6408cee79a8068db18ba2326c783e611d80
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Sun Feb 11 02:12:07 2018 +0100
tests: Cleanup test_clipproperties
pre-commit.hook | 1 -
tests/common.py | 3 +--
tests/test_clipproperties.py | 29 ++++++++++++-----------------
3 files changed, 13 insertions(+), 20 deletions(-)
---
diff --git a/pre-commit.hook b/pre-commit.hook
index cdd8928..4b0f63a 100755
--- a/pre-commit.hook
+++ b/pre-commit.hook
@@ -55,7 +55,6 @@ pitivi/viewer/title_overlay.py
pitivi/viewer/viewer.py
tests/common.py
tests/test_check.py
-tests/test_clipproperties.py
tests/test_common.py
tests/test_log.py
tests/test_media_library.py
diff --git a/tests/common.py b/tests/common.py
index 9a65d9a..3011fa6 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -92,7 +92,7 @@ def create_pitivi(**settings):
def create_timeline_container():
- app = create_pitivi_mock()
+ app = create_pitivi_mock(leftClickAlsoSeeks=False)
project_manager = ProjectManager(app)
project_manager.newBlankProject()
project = project_manager.current_project
@@ -105,7 +105,6 @@ def create_timeline_container():
timeline.get_parent = mock.MagicMock(return_value=timeline_container)
app.gui.timeline_ui = timeline_container
- timeline.app.settings.leftClickAlsoSeeks = False
return timeline_container
diff --git a/tests/test_clipproperties.py b/tests/test_clipproperties.py
index b2bee89..5023277 100644
--- a/tests/test_clipproperties.py
+++ b/tests/test_clipproperties.py
@@ -16,6 +16,8 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
+"""Tests for the pitivi.clipproperties module."""
+# pylint: disable=protected-access,no-self-use,too-many-locals
import unittest
from unittest import mock
@@ -28,8 +30,10 @@ from tests.test_timeline_timeline import BaseTestTimeline
class EffectPropertiesTest(unittest.TestCase):
+ """Tests for the EffectProperties class."""
- def testCalculateEffectPriority(self):
+ def test_calculate_effect_priority(self):
+ """Checks the effect priority calculation."""
# Dragging 1 onto itself and nearby.
self.assertEqual(1, EffectProperties.calculateEffectPriority(
1, 0, Gtk.TreeViewDropPosition.AFTER))
@@ -79,10 +83,7 @@ class TransformationPropertiesTest(BaseTestTimeline):
return transformation_box
def test_spin_buttons_read(self):
- """
- Tests that the transformation properties spin buttons display
- the correct values of the source properties.
- """
+ """Checks the spin buttons update when the source properties change."""
# Create transformation box
transformation_box = self.setup_transformation_box()
timeline = transformation_box.app.gui.timeline_ui.timeline
@@ -111,10 +112,7 @@ class TransformationPropertiesTest(BaseTestTimeline):
self.assertEqual(new_val, spin_btn_value)
def test_spin_buttons_write(self):
- """
- Tests that changes in spin buttons values are reflected in source
- properties.
- """
+ """Checks the spin buttons changing updates the source properties."""
# Create transformation box
transformation_box = self.setup_transformation_box()
timeline = transformation_box.app.gui.timeline_ui.timeline
@@ -148,10 +146,7 @@ class TransformationPropertiesTest(BaseTestTimeline):
self.assertEqual(current_spin_values[source_prop], source_value)
def test_spin_buttons_source_change(self):
- """
- Check that spin buttons update correctly when changing the selected
- clip.
- """
+ """Checks the spin buttons update when the selected clip changes."""
# Create transformation box
transformation_box = self.setup_transformation_box()
timeline = transformation_box.app.gui.timeline_ui.timeline
@@ -184,7 +179,7 @@ class TransformationPropertiesTest(BaseTestTimeline):
self.assertEqual(spin_buttons[prop].get_value_as_int(), new_values[prop])
def test_keyframes_activate(self):
- """Tests transformation properties keyframes activation."""
+ """Checks transformation properties keyframes activation."""
# Create transformation box
transformation_box = self.setup_transformation_box()
timeline = transformation_box.app.gui.timeline_ui.timeline
@@ -219,7 +214,7 @@ class TransformationPropertiesTest(BaseTestTimeline):
(inpoint + duration, initial_values[prop])])
def test_keyframes_add(self):
- """Tests keyframe creation."""
+ """Checks keyframe creation."""
# Create transformation box
transformation_box = self.setup_transformation_box()
timeline = transformation_box.app.gui.timeline_ui.timeline
@@ -252,7 +247,7 @@ class TransformationPropertiesTest(BaseTestTimeline):
self.assertEqual((timestamp, value), keyframes[index + 1])
def test_keyframes_navigation(self):
- """Tests keyframe navigation."""
+ """Checks keyframe navigation."""
# Create transformation box
transformation_box = self.setup_transformation_box()
timeline = transformation_box.app.gui.timeline_ui.timeline
@@ -301,7 +296,7 @@ class TransformationPropertiesTest(BaseTestTimeline):
prev_index += 1
def test_reset_to_default(self):
- """Tests "reset to default" button."""
+ """Checks "reset to default" button."""
# Create transformation box
transformation_box = self.setup_transformation_box()
timeline = transformation_box.app.gui.timeline_ui.timeline
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]