summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <paulo.alcantara@openbossa.org>2011-04-25 15:52:04 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-04-28 17:43:01 -0300
commit1cc2ccbcd8a58b1219b92d542253fd1a6f3d0913 (patch)
tree60648e839501538044aaebc1e01776579dc2d6a8
parent2130c2dce50f4cd2a3087b480c609878f715e0f6 (diff)
downloadpyside-1cc2ccbcd8a58b1219b92d542253fd1a6f3d0913.tar.gz
pyside-1cc2ccbcd8a58b1219b92d542253fd1a6f3d0913.tar.xz
pyside-1cc2ccbcd8a58b1219b92d542253fd1a6f3d0913.zip
Create unit test for QIPv6Address
Signed-off-by: Paulo Alcantara <paulo.alcantara@openbossa.org> Reviewer: Renato Araujo <renato.araujo@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
-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 9b0be3a..3077155 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 0000000..eeb4c61
--- /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()