mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
0a37fd1928
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.
16 lines
563 B
Python
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()
|
|
|