gstreamer/testsuite/test_pad.py
Johan Dahlin 0a37fd1928 testsuite/event.py (EventFileSrcTest.setUp): Start the pipeline, so we don't get warnings when sending events
Original commit message from CVS:
* testsuite/event.py (EventFileSrcTest.setUp): Start the pipeline,
so we don't get warnings when sending events
(EventTest.setUp): Ditto.

* testsuite/pad.py: New test, only testing simple pad queries so far.

* testsuite/Makefile.am (tests): Add missing tests

* gst/gst.override (_wrap_gst_pad_query): Raise RuntimeError if
the return value is False and only return the queried value.
2004-07-13 09:00:07 +00:00

16 lines
563 B
Python

from common import gst, unittest
class PadTest(unittest.TestCase):
def setUp(self):
self.pipeline = gst.parse_launch('fakesrc name=source ! fakesink')
src = self.pipeline.get_by_name('source')
self.sink = src.get_pad('src')
def testQuery(self):
assert self.sink.query(gst.QUERY_TOTAL, gst.FORMAT_BYTES) == -1
assert self.sink.query(gst.QUERY_POSITION, gst.FORMAT_BYTES) == 0
assert self.sink.query(gst.QUERY_POSITION, gst.FORMAT_TIME) == 0
if __name__ == "__main__":
unittest.main()