Пример #1
0
 def test_hearTellsClient(self):
     """
     When 'hear' is called on a ChatterElement, it should inform its client of what
     was said and by whom.
     """
     from chatthing.chatterbox import ChatRoom
     cb = ChatRoom().makeChatter()
     heard = []
     cb.callRemote = lambda method, who, what: heard.append((method, who, what))
     cb.hear(u'Hello', u'Chat')
     self.assertEquals(heard, [('displayUserMessage', u'Hello', u'Chat')])
Пример #2
0
 def test_wallTellsClient(self):
     """
     When 'wall' is called on a ChatterElement, it should inform its client of
     the message.
     """
     from chatthing.chatterbox import ChatRoom
     cb = ChatRoom().makeChatter()
     heard = []
     cb.callRemote = lambda method, msg: heard.append((method, msg))
     cb.wall(u'Message for everyone...')
     self.assertEquals(heard, [('displayMessage', u'Message for everyone...')])