def test_time_disker_running_and_happy(self): properties = { 'directory': '/tmp', 'rotate-type': 'time', 'time': 10, 'symlink-to-current-recording': 'current' } dc = comptest.ComponentWrapper('disk-consumer', disker.Disker, name='disk-video', props=properties, plugs=self.build_plugs([self.s])) self.tp.set_flow([self.prod, dc]) d = self.tp.start_flow() # wait for the disker to go happy d.addCallback(lambda _: dc.wait_for_mood(moods.happy)) # let it run for a few seconds d.addCallback(lambda _: comptest.delayed_d(30, _)) # and finally stop the flow d.addCallback(lambda _: self.tp.stop_flow()) return d
def test_config_rotate_invalid(self): properties = {'directory': '/tmp', 'rotate-type': 'invalid'} dc = comptest.ComponentWrapper('disk-consumer', disker.Disker, name='dc', cfg=self.get_config(properties)) d = dc.instantiate() return self.failUnlessFailure(d, comptest.ComponentSad)
def test_config_rotate_time(self): properties = {'directory': '/tmp', 'rotate-type': 'time', 'time': 10} dc = comptest.ComponentWrapper('disk-consumer', disker.Disker, name='dc', cfg=self.get_config(properties)) d = dc.instantiate() # don't wait for it to go hungry, be happy with just # instantiating correctly return d
def test_config_minimal(self): properties = {'directory': '/tmp'} dc = comptest.ComponentWrapper('disk-consumer', disker.Disker, name='dc', cfg=self.get_config(properties)) d = dc.instantiate() # actually wait for the component to start up and go hungry d.addCallback(lambda _: dc.wait_for_mood(moods.hungry)) d.addCallback(lambda _: dc.stop()) return d
def _initComp(self): self.compWrapper =\ comptest.ComponentWrapper('icy-streamer', icystreamer.ICYStreamer, name='icy-streamer', props={'metadata-interval': 0.5, 'port': self._getFreePort()}) self.tp.set_flow([self.prod, self.compWrapper]) d = self.tp.start_flow() d.addCallback( lambda _: self.__setattr__('comp', self.compWrapper.comp)) # wait for the converter to go happy d.addCallback(lambda _: self.compWrapper.wait_for_mood(moods.happy)) return d
def _videoscale_test(self, properties, par, w, h, exact=False): vc = comptest.ComponentWrapper('video-converter', video.Converter, name='video-converter', cfg={'properties': properties}) self.tp.set_flow([self.prod, vc]) d = self.tp.start_flow() # wait for the converter to go happy d.addCallback(lambda _: vc.wait_for_mood(moods.happy)) d.addCallback(self._test_videoscale, vc, par, w, h, exact=exact) # let it run for a few seconds d.addCallback(lambda _: comptest.delayed_d(2, _)) # and finally stop the flow d.addCallback(lambda _: self.tp.stop_flow()) return d
def test_deinterlace_auto_True(self): properties = {'deinterlace-method': "tomsmocomp"} vc = comptest.ComponentWrapper('video-converter', video.Converter, name='video-converter', cfg={'properties': properties}) self.tp.set_flow([self.prod, vc]) d = self.tp.start_flow() # wait for the converter to go happy d.addCallback(lambda _: vc.wait_for_mood(moods.happy)) # let it run for a few seconds d.addCallback(lambda _: comptest.delayed_d(10, _)) d.addCallback(self._test_interlaced, vc, False) # and finally stop the flow d.addCallback(lambda _: self.tp.stop_flow()) return d
def test_running_and_happy(self): vc = comptest.ComponentWrapper( 'video-converter', video.Converter, name='video-converter', cfg={'properties': { 'deinterlace-mode': 'disabled' }}) self.tp.set_flow([self.prod, vc]) d = self.tp.start_flow() # wait for the converter to go happy d.addCallback(lambda _: vc.wait_for_mood(moods.happy)) # let it run for a few seconds d.addCallback(lambda _: comptest.delayed_d(5, _)) # and finally stop the flow d.addCallback(lambda _: self.tp.stop_flow()) return d