[pitivi: 10/14] tests: make test_pipeline[_action] use better sources/caps
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi: 10/14] tests: make test_pipeline[_action] use better sources/caps
- Date: Fri, 1 Oct 2010 12:17:01 +0000 (UTC)
commit 25418041a92f1b9c96dd1fc69acc31076ece126c
Author: Alessandro Decina <alessandro d gmail com>
Date: Wed Sep 29 16:23:57 2010 +0200
tests: make test_pipeline[_action] use better sources/caps
tests/test_pipeline.py | 18 +++++++++++-------
tests/test_pipeline_action.py | 4 ++--
2 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py
index 3d0ab1c..eb8a54a 100644
--- a/tests/test_pipeline.py
+++ b/tests/test_pipeline.py
@@ -26,7 +26,8 @@ from unittest import main
from pitivi.pipeline import Pipeline, STATE_NULL, STATE_READY, STATE_PAUSED, STATE_PLAYING, PipelineError
from pitivi.action import Action, STATE_ACTIVE, STATE_NOT_ACTIVE
from pitivi.stream import AudioStream, VideoStream
-from common import TestCase, SignalMonitor, FakeSourceFactory, FakeSinkFactory, FakeEffectFactory
+from common import TestCase, SignalMonitor, FakeSinkFactory, FakeEffectFactory
+from pitivi.factories.test import VideoTestSourceFactory
class BogusAction(Action):
pass
@@ -183,8 +184,9 @@ class TestPipeline(TestCase):
self.assertEquals(self.monitor.state_changed_count, 5)
def testGetReleaseBinForFactoryStream(self):
- factory = FakeSourceFactory()
- stream = VideoStream(gst.Caps('any'), 'src0')
+ factory = VideoTestSourceFactory()
+ stream = VideoStream(gst.Caps('video/x-raw-rgb; video/x-raw-yuv'),
+ 'src0')
factory.addOutputStream(stream)
# try to get a cached instance
@@ -210,8 +212,9 @@ class TestPipeline(TestCase):
self.pipeline.releaseBinForFactoryStream(factory, stream)
def testGetReleaseTeeForFactoryStream(self):
- factory = FakeSourceFactory()
- stream = VideoStream(gst.Caps('any'), 'src')
+ factory = VideoTestSourceFactory()
+ stream = VideoStream(gst.Caps('video/x-raw-rgb; video/x-raw-yuv'),
+ 'src')
factory.addOutputStream(stream)
self.failUnlessRaises(PipelineError,
@@ -249,7 +252,8 @@ class TestPipeline(TestCase):
# should always fail with a sink bin
factory2 = FakeSinkFactory()
- stream2= VideoStream(gst.Caps('any'), 'src')
+ stream2 = VideoStream(gst.Caps('video/x-raw-rgb; video/x-raw-yuv'),
+ 'src')
factory2.addInputStream(stream2)
self.failUnlessRaises(PipelineError,
@@ -301,7 +305,7 @@ class TestPipeline(TestCase):
self.pipeline.releaseQueueForFactoryStream, factory, stream)
# should always fail with a src bin
- factory2 = FakeSourceFactory()
+ factory2 = VideoTestSourceFactory()
stream2 = VideoStream(gst.Caps('any'), 'src')
factory2.addOutputStream(stream2)
diff --git a/tests/test_pipeline_action.py b/tests/test_pipeline_action.py
index a452f0a..ac709ea 100644
--- a/tests/test_pipeline_action.py
+++ b/tests/test_pipeline_action.py
@@ -28,6 +28,7 @@ from unittest import TestCase, main
from pitivi.pipeline import Pipeline, STATE_READY, STATE_PLAYING, STATE_NULL
from pitivi.action import Action, STATE_ACTIVE, STATE_NOT_ACTIVE, ActionError
from pitivi.stream import MultimediaStream, VideoStream
+from pitivi.factories.test import VideoTestSourceFactory
from common import TestCase
import common
import gst
@@ -51,8 +52,7 @@ class TestPipelineAction(TestCase):
"""Testing pipeline state interaction"""
p = Pipeline()
a = Action()
- src = common.FakeSourceFactory()
- src.addOutputStream(MultimediaStream(gst.Caps("any"), pad_name="src"))
+ src = VideoTestSourceFactory()
sink = common.FakeSinkFactory()
sink.addInputStream(MultimediaStream(gst.Caps("any"), pad_name="sink"))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]