aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/QtNetwork/CMakeLists.txt1
-rw-r--r--tests/QtNetwork/qipv6address_test.py22
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/QtNetwork/CMakeLists.txt b/tests/QtNetwork/CMakeLists.txt
index 9b0be3abf..307715547 100644
--- a/tests/QtNetwork/CMakeLists.txt
+++ b/tests/QtNetwork/CMakeLists.txt
@@ -4,3 +4,4 @@ PYSIDE_TEST(accessManager_test.py)
PYSIDE_TEST(http_test.py)
PYSIDE_TEST(tcpserver_test.py)
PYSIDE_TEST(udpsocket_test.py)
+PYSIDE_TEST(qipv6address_test.py)
diff --git a/tests/QtNetwork/qipv6address_test.py b/tests/QtNetwork/qipv6address_test.py
new file mode 100644
index 000000000..eeb4c61cb
--- /dev/null
+++ b/tests/QtNetwork/qipv6address_test.py
@@ -0,0 +1,22 @@
+'''Test cases for QIPv6Address'''
+
+import unittest
+
+from PySide.QtNetwork import *
+
+class QIPv6AddressGetItemTest(unittest.TestCase):
+ def testLength(self):
+ ip = QIPv6Address()
+ self.assertEqual(len(ip), 16)
+
+ def testSetItemNegativeIndex(self):
+ ip = QIPv6Address()
+ ip[-1] = 8
+ self.assertEqual(ip[-1], 8)
+
+ def testSetItemLargeIndex(self):
+ ip = QIPv6Address()
+ self.assertRaises(IndexError, ip.__setitem__, 32, 16)
+
+if __name__ == '__main__':
+ unittest.main()