def test_monitor_source_switch(self): freq1 = 1e6 freq2 = 2e6 # TODO: Also test signal type switching (not yet supported by SimulatedDeviceForTest) top = Top(devices={ 's1': SimulatedDeviceForTest(freq=freq1), 's2': SimulatedDeviceForTest(freq=freq2), }) top.set_source_name('s1') self.assertEqual(top.state()['monitor'].get().get_fft_info()[0], freq1) top.set_source_name('s2') self.assertEqual(top.state()['monitor'].get().get_fft_info()[0], freq2)
def test_receiver_device_default(self): """ Receiver should default to the monitor device, not other receiver's device. """ top = Top(devices={ 's1': SimulatedDeviceForTest(), 's2': SimulatedDeviceForTest(), }) (_key, receiver1) = top.add_receiver('AM', key='a') top.set_source_name('s2') receiver1.set_device_name('s1') (_key, receiver2) = top.add_receiver('AM', key='b') self.assertEquals(receiver2.get_device_name(), 's2') self.assertEquals(receiver1.get_device_name(), 's1')