[pitivi] tests: Fix TestMediaLibrary tests run twice



commit c8296ea07e4af8f425af59d0befc5f2c9644a71b
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Sat May 28 13:56:06 2016 +0200

    tests: Fix TestMediaLibrary tests run twice
    
    $ nosetests tests/test_media_library.py tests/test_previewers.py
    
    BEFORE:
    Ran 16 tests in 5.478s
    
    AFTER:
    Ran 9 tests in 3.028s
    
    Differential Revision: https://phabricator.freedesktop.org/D1020

 tests/test_media_library.py |    6 +++++-
 tests/test_previewers.py    |    8 ++++----
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/tests/test_media_library.py b/tests/test_media_library.py
index 27745d1..1868c80 100644
--- a/tests/test_media_library.py
+++ b/tests/test_media_library.py
@@ -34,7 +34,8 @@ def fakeSwitchProxies(asset):
     timeline.TimelineContainer.switchProxies(mock.MagicMock(), asset)
 
 
-class TestMediaLibrary(common.TestCase):
+class BaseTestMediaLibrary(common.TestCase):
+
     def __init__(self, *args):
         common.TestCase.__init__(self, *args)
         self.app = None
@@ -113,6 +114,9 @@ class TestMediaLibrary(common.TestCase):
         self.mainloop.run()
         self.assertFalse(self.medialibrary._progressbar.props.visible)
 
+
+class TestMediaLibrary(BaseTestMediaLibrary):
+
     def stopUsingProxies(self, delete_proxies=False):
         sample_name = "30fps_numeroted_frames_red.mkv"
         self.runCheckImport([sample_name])
diff --git a/tests/test_previewers.py b/tests/test_previewers.py
index d434741..4afeeaf 100644
--- a/tests/test_previewers.py
+++ b/tests/test_previewers.py
@@ -27,10 +27,11 @@ from pitivi.timeline.previewers import get_wavefile_location_for_uri
 from pitivi.timeline.previewers import getThumbnailCache
 from pitivi.timeline.previewers import THUMB_HEIGHT
 from tests import common
-from tests.test_media_library import TestMediaLibrary
+from tests.test_media_library import BaseTestMediaLibrary
 
 
-class TestPreviewers(common.TestCase):
+class TestPreviewers(BaseTestMediaLibrary):
+
     def testCreateThumbnailBin(self):
         pipeline = Gst.parse_launch("uridecodebin name=decode uri=file:///some/thing"
                                     " waveformbin name=wavebin ! fakesink qos=false name=faked")
@@ -39,9 +40,8 @@ class TestPreviewers(common.TestCase):
         self.assertTrue(wavebin)
 
     def testWaveFormAndThumbnailCreated(self):
-        testmedialib = TestMediaLibrary()
         sample_name = "1sec_simpsons_trailer.mp4"
-        testmedialib.runCheckImport([sample_name])
+        self.runCheckImport([sample_name])
 
         sample_uri = common.get_sample_uri(sample_name)
         asset = GES.UriClipAsset.request_sync(sample_uri)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]