Created unittest for QtXmlPatterns.
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>,
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
27458bcd2f
commit
653bb5149b
1 changed files with 30 additions and 0 deletions
30
tests/qtxmlpatterns/import_test.py
Normal file
30
tests/qtxmlpatterns/import_test.py
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
from PySide.QtCore import *
|
||||||
|
from PySide.QtXmlPatterns import QXmlSchema
|
||||||
|
from helper import UsesQCoreApplication
|
||||||
|
|
||||||
|
class QXmlPatternsTest(UsesQCoreApplication):
|
||||||
|
|
||||||
|
def testSchema(self):
|
||||||
|
data = QByteArray('''<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
||||||
|
<xsd:schema
|
||||||
|
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
|
||||||
|
xmlns=\"http://qt.nokia.com/xmlschematest\"
|
||||||
|
targetNamespace=\"http://qt.nokia.com/xmlschematest\"
|
||||||
|
version=\"1.0\"
|
||||||
|
elementFormDefault=\"qualified\">
|
||||||
|
</xsd:schema>''')
|
||||||
|
|
||||||
|
buf = QBuffer(data)
|
||||||
|
buf.open(QIODevice.ReadOnly)
|
||||||
|
|
||||||
|
schema = QXmlSchema()
|
||||||
|
schema.load(buf)
|
||||||
|
self.assert_(schema.isValid())
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue