Ejemplo n.º 1
0
class TestRadioRunner:
    def setup_method(self, method):
        self.radio = RadioRunner()

    def teardown_method(self, method):
        self.radio.stop_radio()

    def test_run_not_existing_radio(self):
        self.radio.stations['invalid'] = 'mplayer mms://surely.invalid.stream.com'
        with pytest.raises(BufferError):
            self.radio.run_radio('invalid')

    def test_run_radio_wrong_station(self):
        with pytest.raises(KeyError):
            self.radio.run_radio('wrong_station')

    def test_run_radio_station(self, radio_station):
        self.radio.run_radio(radio_station, TESTMODE)
Ejemplo n.º 2
0
import sys

from radio_runner import RadioRunner

__author__ = 'adrian'

if __name__ == '__main__':
    radio = RadioRunner()
    radio.run_radio(sys.argv[1])
    radio.radio_process.wait()