Exemple #1
0
    def test_pulse_full_name(self):
        p = Pulse('pulse1')
        self.assertEqual(p.full_name, 'pulse1')
        p.id = 2
        self.assertEqual(p.full_name, 'pulse1[2]')

        p = DCPulse('pulse2')
        self.assertEqual(p.full_name, 'pulse2')
        p.id = 2
        self.assertEqual(p.full_name, 'pulse2[2]')
Exemple #2
0
    def test_pulse_full_name(self):
        p = Pulse('DC', t_start=1)
        self.assertEqual(p.name, 'DC')
        self.assertEqual(p.full_name, 'DC')

        p.id = 0
        self.assertEqual(p.name, 'DC')
        self.assertEqual(p.full_name, 'DC[0]')

        p.id = None
        self.assertEqual(p.name, 'DC')
        self.assertEqual(p.full_name, 'DC')
Exemple #3
0
    def test_pulse_id(self):
        p = Pulse(name='read')
        self.assertEqual(p.id, None)

        self.assertEqual(p.full_name, 'read')
        p.id = 0
        self.assertEqual(p.name, 'read')
        self.assertEqual(p.full_name, 'read[0]')
        self.assertTrue(p.satisfies_conditions(name='read', id=0))
        self.assertTrue(p.satisfies_conditions(name='read[0]'))
Exemple #4
0
    def test_copied_pulse_full_name(self):
        p = Pulse('DC', t_start=1)

        p_copy = copy(p)
        p_copy.name = 'DC2'

        p.id = 0
        self.assertEqual('DC', p.name)
        self.assertEqual('DC[0]', p.full_name)

        p_copy.id = 1
        p_copy.full_name
        self.assertEqual('DC2', p_copy.name)
        self.assertEqual('DC2[1]', p_copy.full_name)
Exemple #5
0
 def test_pulse_no_id(self):
     p = Pulse('name')
     p.id = None