aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-04-18 14:50:29 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:12 -0300
commit98a0d2ba6f3e02c3f3e4aa88e52d0aa9b4273446 (patch)
tree5e345c94b0ad070aa7b7a6f9692b199748fa9b5c
parentdab522fe31c1fdae817f93d8d3621086e4e959e1 (diff)
Created unit test for ObjectDescription.fromIndex.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--tests/phonon/CMakeLists.txt1
-rw-r--r--tests/phonon/qobjectdescription_test.py18
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/phonon/CMakeLists.txt b/tests/phonon/CMakeLists.txt
index ee94c0ba9..85675155d 100644
--- a/tests/phonon/CMakeLists.txt
+++ b/tests/phonon/CMakeLists.txt
@@ -5,3 +5,4 @@ if (NOT WIN32 OR NOT ${QTVERSION} VERSION_EQUAL 4.7.1)
endif()
PYSIDE_TEST(bug_328.py)
PYSIDE_TEST(capabilities_test.py)
+PYSIDE_TEST(qobjectdescription_test.py)
diff --git a/tests/phonon/qobjectdescription_test.py b/tests/phonon/qobjectdescription_test.py
new file mode 100644
index 000000000..7312ee352
--- /dev/null
+++ b/tests/phonon/qobjectdescription_test.py
@@ -0,0 +1,18 @@
+import unittest
+
+from PySide.QtCore import *
+from PySide import phonon
+
+from helper import UsesQCoreApplication
+
+class CapabilitiesTest(UsesQCoreApplication):
+ def testFromIndex(self):
+ devices = phonon.Phonon.BackendCapabilities.availableAudioOutputDevices()
+ for device in devices:
+ self.assert_(isinstance(device, phonon.Phonon.AudioOutputDevice))
+ other = phonon.Phonon.AudioOutputDevice.fromIndex(device.index())
+ self.assertEqual(device.name(), other.name())
+ self.assertEqual(device.index(), other.index())
+
+if __name__ == '__main__':
+ unittest.main()