Fix the QtMultimedia/audio_test.py to accept computers with only null
device.
This commit is contained in:
parent
67b868ccb9
commit
4b0eaa7796
1 changed files with 7 additions and 1 deletions
|
|
@ -9,13 +9,19 @@ from PySide.QtMultimedia import *
|
|||
class testAudioDevices(unittest.TestCase):
|
||||
|
||||
def testListDevices(self):
|
||||
valid = False
|
||||
devices = QAudioDeviceInfo.availableDevices(QAudio.AudioOutput)
|
||||
if not len(devices):
|
||||
return
|
||||
|
||||
valid = True
|
||||
for devInfo in devices:
|
||||
if devInfo.deviceName() == 'null':
|
||||
continue
|
||||
# skip the test if the only device found is a invalid device
|
||||
if len(devices) == 1:
|
||||
return
|
||||
else:
|
||||
continue
|
||||
fmt = QAudioFormat()
|
||||
for codec in devInfo.supportedCodecs():
|
||||
fmt.setCodec(codec)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue