Mercurial > libervia-backend
comparison src/test/test_plugin_misc_radiocol.py @ 861:4d091738275c
test: skip radiocol tests if the sound samples are not found
author | souliane <souliane@mailoo.org> |
---|---|
date | Mon, 24 Feb 2014 12:57:56 +0100 |
parents | c5a8f602662b |
children | 95dabdb0c799 |
comparison
equal
deleted
inserted
replaced
860:2b98f5631fba | 861:4d091738275c |
---|---|
30 from twisted.words.protocols.jabber.jid import JID | 30 from twisted.words.protocols.jabber.jid import JID |
31 from twisted.words.xish import domish | 31 from twisted.words.xish import domish |
32 from twisted.internet import reactor | 32 from twisted.internet import reactor |
33 from twisted.internet import defer | 33 from twisted.internet import defer |
34 from twisted.python.failure import Failure | 34 from twisted.python.failure import Failure |
35 from twisted.trial.unittest import SkipTest | |
35 | 36 |
36 from mutagen.oggvorbis import OggVorbis | 37 from mutagen.oggvorbis import OggVorbis |
37 | 38 |
38 import uuid | 39 import uuid |
39 import logging | 40 import logging |
68 self.host.getClient(profile) # init self.host.profiles[profile] | 69 self.host.getClient(profile) # init self.host.profiles[profile] |
69 logger.setLevel(level) | 70 logger.setLevel(level) |
70 self.songs = [] | 71 self.songs = [] |
71 self.playlist = [] | 72 self.playlist = [] |
72 self.sound_dir = self.host.memory.getConfig('', 'media_dir') + '/test/sound/' | 73 self.sound_dir = self.host.memory.getConfig('', 'media_dir') + '/test/sound/' |
73 for filename in os.listdir(self.sound_dir): | 74 try: |
74 if filename.endswith('.ogg'): | 75 for filename in os.listdir(self.sound_dir): |
75 self.songs.append(filename) | 76 if filename.endswith('.ogg'): |
77 self.songs.append(filename) | |
78 except OSError: | |
79 raise SkipTest('The sound samples in sat_media/test/sound were not found') | |
76 | 80 |
77 def _buildPlayers(self, players=[]): | 81 def _buildPlayers(self, players=[]): |
78 """@return: the "started" content built with the given players""" | 82 """@return: the "started" content built with the given players""" |
79 content = "<started" | 83 content = "<started" |
80 if not players: | 84 if not players: |