Esempio n. 1
0
 def test_info_reply_plural(self):
     s = StateDouble()
     c = InfoResponder(s)
     s.users[(1,2)] = User(
         (1,2), "test2", "test", "example.com", [("+o", None)], 6, 0,
         1234, "Joe Bloggs")
     s.servers[1].children = set([2])
     s.servers[2] = Server(1, 2, "test2.example.com", 1234, 1234, 1234,
                           "P10", 0, [], "A test description")
     s.channels["#test2"] = Channel("#test2", 1234)
     c.callback_inforequest((3,6), (1, None))
     self.assertEquals(
         [
             (
                 (1,None),
                 (3,6),
                 "371",
                 ["I know 2 servers and 2 users on 2 channels."]
             ), (
                 (1,None),
                 (3,6),
                 "374",
                 ["End of /INFO list"]
             )
         ],
         s.insight
     )
Esempio n. 2
0
 def test_info_reply(self):
     s = StateDouble()
     c = InfoResponder(s)
     c.callback_inforequest((3,6), (1, None))
     self.assertEquals(
         [
             (
                 (1,None),
                 (3,6),
                 "371",
                 ["I know 1 server and 1 user on 1 channel."]
             ), (
                 (1,None),
                 (3,6),
                 "374",
                 ["End of /INFO list"]
             )
         ],
         s.insight
     )
Esempio n. 3
0
 def test_info_reply_if_relevant(self):
     s = StateDouble()
     c = InfoResponder(s)
     c.callback_inforequest((7,6), (2, None))
     self.assertEquals([], s.insight)