示例#1
0
 def test_open_door_hal(self):
     '''
     This function tests the interface for the 2001 spec.
     '''
     interface = Interface()
     interface.set_user("Dave")
     result = interface.ask("Open the door hal")
     self.assertEqual(result, "I'm afraid I can't do that Dave")
示例#2
0
 def test_set_user_name(self):
     '''
     This function tests the interface for username recognition.
     '''
     interface = Interface()
     result = interface.set_user("Dave")
     self.assertEqual(result, "Hello, Dave.")