def test_server_dict(self): """ Tests the server config :return: Tests results """ data = ConfigManager.get_server_dict() self.assertEqual(True, data[0], "Server: Wrong config")
def test_server_dict(self): """ Tests the server config :return: Tests results """ data = ConfigManager.get_server_dict() self.assertEqual(len(data), 1, "Server: Wrong size of the List")
def register_key(cls, router_ids: List[int], register_all: bool): """ Sends the public-key of the given Routers to an email that is specified in the config-file. :param router_ids: List of unique numbers to identify a Router :param register_all: Register the public-keys of all Routers """ if register_all: for router in cls.get_routers(): reg_pub_key = RegisterPublicKey(router, ConfigManager.get_server_dict()[1]["serverdefaults"]) reg_pub_key.start() reg_pub_key.join() else: for router_id in router_ids: router = cls.get_router_by_id(router_id) reg_pub_key = RegisterPublicKey(router, ConfigManager.get_server_dict()[1]["serverdefaults"]) reg_pub_key.start() reg_pub_key.join()
def test_registration(self): config = ConfigManager.get_server_dict()[1]["serverdefaults"] print("Test Registration Public-Key") router = self._create_router() assert config["smtp_server"] == "smtp.web.de" assert config["smtp_port"] == 587 assert config["email"] == "*****@*****.**" assert config["email_password"] == "passworter" assert config["key_email"] == "*****@*****.**" reg_pub_key = RegisterPublicKey(router, config) reg_pub_key.start() reg_pub_key.join()