Exemple #1
0
 def test_inherit_port(self):
     # Set things up
     test_port = 80
     test_serv_irc = ServerIRC(self.hallo)
     test_serv_irc.name = "test_serv_irc"
     test_serv_irc.server_port = test_port
     test_chan_irc = test_serv_irc.get_channel_by_name("test_chan")
     test_user_irc = test_serv_irc.get_user_by_name("test_user")
     # Run command
     self.function_dispatcher.dispatch("connect irc example.com", test_user_irc, test_chan_irc)
     # Can't check response because I'm using a ServerIRC instead of a ServerMock
     # Find the right server
     assert len(self.hallo.server_list) == 2, "Incorrect number of servers in hallo instance"
     right_server = None  # type: ServerIRC
     for server in self.hallo.server_list:
         if server is not self.server:
             right_server = server
     assert right_server is not None, "New server wasn't found."
     assert right_server.server_port == test_port, "Port incorrect"
Exemple #2
0
 def test_nickserv_password_inherit(self):
     # Set up
     test_nickserv_pass = "******"
     test_serv_irc = ServerIRC(self.hallo)
     test_serv_irc.name = "test_serv_irc"
     test_serv_irc.nickserv_pass = test_nickserv_pass
     test_chan_irc = test_serv_irc.get_channel_by_name("test_chan")
     test_user_irc = test_serv_irc.get_user_by_name("test_user")
     # Run command
     self.function_dispatcher.dispatch("connect irc example.com:80", test_user_irc, test_chan_irc)
     # Can't check response because I'm using a ServerIRC instead of a ServerMock
     # Find the right server
     assert len(self.hallo.server_list) == 2, "Incorrect number of servers in hallo instance."
     right_server = None  # type: ServerIRC
     for server in self.hallo.server_list:
         if server is not self.server:
             right_server = server
     assert right_server is not None, "New server wasn't found."
     assert right_server.nickserv_pass == test_nickserv_pass, "Nickserv password wasn't inherited"