gstreamer/testsuite/test_pipeline.py
Edward Hervey ae75cbd54b gst/: Added GError wrapping,
Original commit message from CVS:
* gst/gst-types.defs:
* gst/gst.defs:
Added GError wrapping,
Removed data field from Buffer,
Added virtual methods to object
Updated to latest API
* gst/gst.override:
wrapped gst_plugin_get_feature_list(), gst_uri_handler_get_protocols(),
gst_registry_pool_list()
* gst/gstbuffer.override:
gst.Buffer() works
get/setters fixed
wrapped gst_buffer_stamp()
* gst/gstbus.override:
wrapped gst_bus_set_sync_handler() and gst_bus_add_watch()
* gst/gstelement.override:
wrapped gst_element_send_event(), gst_element_factory_get_pad_templates()
gst_element_query_convert(), gst_element_get_query_types()
* gst/gstevent.override:
wrapped gst_event_discont_get_value()
* gst/gstmessage.override:
wrapped gst_message_parse_state_changed(), gst_message_parse_error(),
gst_message_parse_warning(), gst_message_parse_tag()
* gst/gstmodule.c:
Added registration of new fundamental type with pygtk
* gst/gstpad.override:
wrapped gst_pad_query(), gst_pad_[add|remove]_[data|event|buffer]_probe(),
gst_pad_query_position(), gst_pad_query_convert()
* gst/gstquery.override:
wrapped gst_query_parse_position(), gst_query_parse_convert(),
gst_query_parse_seeking_query(), gst_query_parse_seeking_reponse()
* gst/pygstminiobject.c:
fixes
* gst/Makefile.am:
added gstbus.override, gstmessage.override, gstquery.override
* testsuite/test_buffer.py:
* testsuite/test_element.py:
* testsuite/test_event.py:
* testsuite/test_pipeline.py:
Updating testsuites
2005-07-12 09:45:58 +00:00

39 lines
1.5 KiB
Python

from common import gst, unittest
class PipelineConstructor(unittest.TestCase):
def testGoodConstructor(self):
name = 'test-pipeline'
pipeline = gst.Pipeline(name)
assert pipeline is not None, 'pipeline is None'
assert isinstance(pipeline, gst.Pipeline), 'pipeline is not a GstPipline'
assert pipeline.get_name() == name, 'pipelines name is wrong'
## class ThreadConstructor(unittest.TestCase):
## def testCreate(self):
## thread = gst.Thread('test-thread')
## assert thread is not None, 'thread is None'
## assert isinstance(thread, gst.Thread)
class Pipeline(unittest.TestCase):
def setUp(self):
self.pipeline = gst.Pipeline('test-pipeline')
source = gst.element_factory_make('fakesrc', 'source')
source.set_property('num-buffers', 5)
sink = gst.element_factory_make('fakesink', 'sink')
self.pipeline.add_many(source, sink)
gst.element_link_many(source, sink)
def testRun(self):
self.assertEqual(self.pipeline.get_state(), gst.STATE_NULL)
self.pipeline.set_state(gst.STATE_PLAYING)
self.assertEqual(self.pipeline.get_state(), gst.STATE_PLAYING)
while self.pipeline.iterate():
pass
self.assertEqual(self.pipeline.get_state(), gst.STATE_PAUSED)
self.pipeline.set_state(gst.STATE_NULL)
self.assertEqual(self.pipeline.get_state(), gst.STATE_NULL)
if __name__ == "__main__":
unittest.main()