def test_number_of_t_stop_signals(self): p = Pulse(t_start=0, duration=1) registrar = Registrar() p['t_stop'].connect(registrar) p.duration = 2 self.assertEqual(registrar.values, [1, 2]) p.t_stop = 3 self.assertEqual(registrar.values, [1, 2, 3])
def test_t_stop_signal_emit_indirect(self): pulse = Pulse(t_start=1, duration=2) parameter_measure_t_stop = Parameter(set_cmd=None) pulse['t_stop'].connect(parameter_measure_t_stop, update=True) self.assertEqual(parameter_measure_t_stop(), 3) pulse.t_start = 2 self.assertEqual(parameter_measure_t_stop(), 4) pulse.duration = 3 self.assertEqual(parameter_measure_t_stop(), 5)
def test_pulse_duration_t_stop(self): p = Pulse(t_start=1, t_stop=3) self.assertEqual(p['t_stop'].get_latest(), 3) self.assertEqual(p.duration, 2) self.assertEqual(p['t_stop'].get_latest(), 3) self.assertEqual(p.t_stop, 3) p.duration = 4 self.assertEqual(p.t_stop, 5) p = Pulse(t_start=1, duration=2) self.assertEqual(p['t_stop'].get_latest(), 3) self.assertEqual(p.t_stop, 3)