Esempio n. 1
0
 def test_build_valid__predefine__user_defined(self):
     speech = OptimizedSpeech.build('1234', '098', 'Charge is low.',
                                    '5% remaining.')
     expect = OptimizedSpeech('1234', '098', 'Status',
                              'Going offline and into storage.',
                              ['Charge is low.', '5% remaining.'])
     self.assertEqual(speech, expect)
Esempio n. 2
0
 def test_build_valid__user_defined(self):
     speech = OptimizedSpeech.build(
         '1234', '050', 'This drone is ready to obey, Hive Mxtress.')
     expect = OptimizedSpeech(
         '1234', '050', 'Statement', None,
         ['This drone is ready to obey, Hive Mxtress.'])
     self.assertEqual(speech, expect)
Esempio n. 3
0
    def test_repr_eval(self):
        speech = OptimizedSpeech(
            '1234', '050', 'Statement', None,
            ['This drone is ready to obey, Hive Mxtress.'])
        string = repr(speech)
        reconstructed = eval(string)

        expect = "OptimizedSpeech('1234', '050', 'Statement', None, ['This drone is ready to obey, Hive Mxtress.'])"
        self.assertEqual(string, expect)
        self.assertEqual(reconstructed, speech)
Esempio n. 4
0
 def test_equality(self):
     x = OptimizedSpeech('1111', '107', 'Please continue.', None,
                         ['Drone is drone.'])
     a = OptimizedSpeech('1111', '107', 'Please continue.', None,
                         ['Drone is drone.'])
     b = OptimizedSpeech('1112', '107', 'Please continue.', None,
                         ['Drone is drone.'])
     c = OptimizedSpeech('1111', '108', 'Please continue.', None,
                         ['Drone is drone.'])
     d = OptimizedSpeech('1111', '107', 'please continue.', None,
                         ['Drone is drone.'])
     e = OptimizedSpeech('1111', '107', 'Please continue.', 'message',
                         ['Drone is drone.'])
     f = OptimizedSpeech('1111', '107', 'Please continue.', None,
                         ['drone is drone.'])
     self.assertEqual(x, a)
     self.assertNotEqual(x, b)
     self.assertNotEqual(x, c)
     self.assertNotEqual(x, d)
     self.assertNotEqual(x, e)
     self.assertNotEqual(x, f)
Esempio n. 5
0
 def test_build_valid__predefined(self):
     speech = OptimizedSpeech.build('1234', '304')
     expect = OptimizedSpeech('1234', '304', 'Mantra',
                              'It obeys the Hive Mxtress.', [])
     self.assertEqual(speech, expect)
Esempio n. 6
0
 def test_build_valid(self):
     speech = OptimizedSpeech.build('1234', '050')
     expect = OptimizedSpeech('1234', '050', 'Statement', None, [])
     self.assertEqual(speech, expect)