mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
testsuite/test_element.py: add another link test
Original commit message from CVS: 2006-02-01 Thomas Vander Stichele <thomas at apestaart dot org> * testsuite/test_element.py: add another link test
This commit is contained in:
parent
b06a9be61e
commit
2f3f34b7af
3 changed files with 43 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2006-02-01 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* testsuite/test_element.py:
|
||||
add another link test
|
||||
|
||||
2006-01-30 Edward Hervey <edward@fluendo.com>
|
||||
|
||||
* configure.ac:
|
||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit bc4325349e8d0ec90aa5c5e74566880cc2e82527
|
||||
Subproject commit 0b93085188e83fe678ec5ded2823cd7c24dfa843
|
|
@ -222,11 +222,47 @@ class DebugTest(TestCase):
|
|||
e.set_property("name", "testelement")
|
||||
e.break_it_down()
|
||||
|
||||
class LinkNoPadsTest(TestCase):
|
||||
class LinkTest(TestCase):
|
||||
def testLinkNoPads(self):
|
||||
src = gst.Bin()
|
||||
sink = gst.Bin()
|
||||
self.assertRaises(gst.LinkError, src.link, sink)
|
||||
|
||||
def testLink(self):
|
||||
src = gst.element_factory_make('fakesrc')
|
||||
sink = gst.element_factory_make('fakesink')
|
||||
self.failUnless(src.link(sink))
|
||||
# FIXME: this unlink leaks, no idea why
|
||||
# src.unlink(sink)
|
||||
# print src.__gstrefcount__
|
||||
|
||||
def testLinkPads(self):
|
||||
src = gst.element_factory_make('fakesrc')
|
||||
sink = gst.element_factory_make('fakesink')
|
||||
# print src.__gstrefcount__
|
||||
self.failUnless(src.link_pads("src", sink, "sink"))
|
||||
src.unlink_pads("src", sink, "sink")
|
||||
|
||||
def testLinkFiltered(self):
|
||||
# a filtered link uses capsfilter and thus needs a bin
|
||||
bin = gst.Bin()
|
||||
src = gst.element_factory_make('fakesrc')
|
||||
sink = gst.element_factory_make('fakesink')
|
||||
bin.add(src, sink)
|
||||
caps = gst.caps_from_string("audio/x-raw-int")
|
||||
|
||||
self.failUnless(src.link(sink, caps))
|
||||
|
||||
# DANGER WILL. src is not actually connected to sink, since
|
||||
# there's a capsfilter in the way. What a leaky abstraction.
|
||||
# FIXME
|
||||
# src.unlink(sink)
|
||||
|
||||
# instead, mess with pads directly
|
||||
pad = src.get_pad('src')
|
||||
pad.unlink(pad.get_peer())
|
||||
pad = sink.get_pad('sink')
|
||||
pad.get_peer().unlink(pad)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in a new issue