Fix phonon playing test
Wasn't playing anything as no output was being connected to the source.
This commit is contained in:
parent
8ba349cfed
commit
6d2bdf8907
1 changed files with 11 additions and 5 deletions
16
tests/phonon/basic_playing_test.py
Normal file → Executable file
16
tests/phonon/basic_playing_test.py
Normal file → Executable file
|
|
@ -25,8 +25,17 @@ class TestSimplePlaying(UsesQCoreApplication):
|
||||||
|
|
||||||
self.called = False
|
self.called = False
|
||||||
|
|
||||||
|
# prevent locking with:
|
||||||
|
# request to play a stream, but no valid audio ...
|
||||||
|
self.output = phonon.Phonon.AudioOutput()
|
||||||
|
self.path = phonon.Phonon.createPath(self.media, self.output)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
super(TestSimplePlaying, self).tearDown()
|
super(TestSimplePlaying, self).tearDown()
|
||||||
|
del self.path
|
||||||
|
del self.output
|
||||||
|
del self.media
|
||||||
|
del self.source
|
||||||
|
|
||||||
def testFinishedSignal(self):
|
def testFinishedSignal(self):
|
||||||
# Should pass if finished() is called
|
# Should pass if finished() is called
|
||||||
|
|
@ -37,12 +46,9 @@ class TestSimplePlaying(UsesQCoreApplication):
|
||||||
self.assertEqual(self.media.currentSource(), self.source)
|
self.assertEqual(self.media.currentSource(), self.source)
|
||||||
|
|
||||||
def testPathCreation(self):
|
def testPathCreation(self):
|
||||||
output = phonon.Phonon.AudioOutput()
|
|
||||||
path = phonon.Phonon.createPath(self.media, output)
|
|
||||||
|
|
||||||
# FIXME Both functions below are not exported by PyQt4
|
# FIXME Both functions below are not exported by PyQt4
|
||||||
self.assertEqual(path.sink(), output)
|
self.assertEqual(self.path.sink(), self.output)
|
||||||
self.assertEqual(path.source(), self.media)
|
self.assertEqual(self.path.source(), self.media)
|
||||||
|
|
||||||
def state_cb(self, newState, OldState):
|
def state_cb(self, newState, OldState):
|
||||||
self.called = True
|
self.called = True
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue