mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
Add xml tests
Original commit message from CVS: Add xml tests
This commit is contained in:
parent
85e78b96f3
commit
7020315e74
2 changed files with 28 additions and 1 deletions
|
@ -6,7 +6,8 @@ tests = \
|
|||
event.py \
|
||||
interface.py \
|
||||
pad.py \
|
||||
pipeline.py
|
||||
pipeline.py \
|
||||
test_xml.py
|
||||
|
||||
check-local:
|
||||
@PYTHONPATH=$(PYTHONPATH):$(top_builddir):$(top_builddir)/gst/.libs $(PYTHON) $(srcdir)/runtests.py
|
||||
|
|
26
testsuite/test_xml.py
Normal file
26
testsuite/test_xml.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
from common import gst, unittest
|
||||
|
||||
class PadTest(unittest.TestCase):
|
||||
|
||||
def testQuery(self):
|
||||
xml = gst.XML()
|
||||
xml.parse_memory("""<?xml version="1.0"?>
|
||||
<gstreamer xmlns:gst="http://gstreamer.net/gst-core/1.0/">
|
||||
<gst:element>
|
||||
<gst:name>test-pipeline</gst:name>
|
||||
<gst:type>pipeline</gst:type>
|
||||
<gst:param>
|
||||
<gst:name>name</gst:name>
|
||||
<gst:value>test-pipeline</gst:value>
|
||||
</gst:param>
|
||||
</gst:element>
|
||||
</gstreamer>""")
|
||||
elements = xml.get_topelements()
|
||||
assert len(elements) == 1
|
||||
element = elements[0]
|
||||
assert isinstance(element, gst.Pipeline)
|
||||
assert element.get_name() == 'test-pipeline'
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
Loading…
Reference in a new issue