Beispiel #1
0
 def test_add_newline(self):
     ChatLog.append("foo")
     ChatLog.append("\n")
     ChatLog.append("bar")
     self.assertEqual(ChatLog.read(), "foo\nbar")
Beispiel #2
0
 def test_append_to_chat(self):
     for i in range(10):
         ChatLog.append(self.testString + str(i))
     self.assertEqual(ChatLog.read(), "test5\ntest6\ntest7\ntest8\ntest9")
Beispiel #3
0
 def test_add_empty_msg(self):
     ChatLog.append("foo")
     ChatLog.append("")
     ChatLog.append("bar")
     self.assertEqual(ChatLog.read(), "foo\nbar")
Beispiel #4
0
def handle_event(json):
    ChatLog.append(json['msg'])
    emit("responce", json['msg'], broadcast=True)