test: skip radiocol tests if the sound samples are not found
This commit is contained in:
parent
c2408dc57d
commit
470e4f4edf
1 changed files with 7 additions and 3 deletions
|
|
@ -32,6 +32,7 @@ from twisted.words.xish import domish
|
|||
from twisted.internet import reactor
|
||||
from twisted.internet import defer
|
||||
from twisted.python.failure import Failure
|
||||
from twisted.trial.unittest import SkipTest
|
||||
|
||||
from mutagen.oggvorbis import OggVorbis
|
||||
|
||||
|
|
@ -70,9 +71,12 @@ class RadiocolTest(helpers.SatTestCase):
|
|||
self.songs = []
|
||||
self.playlist = []
|
||||
self.sound_dir = self.host.memory.getConfig('', 'media_dir') + '/test/sound/'
|
||||
for filename in os.listdir(self.sound_dir):
|
||||
if filename.endswith('.ogg'):
|
||||
self.songs.append(filename)
|
||||
try:
|
||||
for filename in os.listdir(self.sound_dir):
|
||||
if filename.endswith('.ogg'):
|
||||
self.songs.append(filename)
|
||||
except OSError:
|
||||
raise SkipTest('The sound samples in sat_media/test/sound were not found')
|
||||
|
||||
def _buildPlayers(self, players=[]):
|
||||
"""@return: the "started" content built with the given players"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue