class TestHaproxyDeriverAllFunctions(unittest.TestCase): def setUp(self): self.remote_socket = RemoteSocketOperation(device_fake, backend, rserver) self.remote_socket.ssh = Mock() file_channel = MagicMock(spec=file) self.remote_socket.ssh.exec_command.return_value = [file_channel, file_channel, file_channel] self.driver = HaproxyDriver(conf, device_fake) def test_create_real_server(self): self.driver.create_real_server(haproxy_rserver) def test_delete_real_server(self): self.driver.delete_real_server(haproxy_rserver) def test_suspend_real_server(self): self.driver.suspend_real_server(server_farm, rserver) def test_activate_real_server(self): self.driver.activate_real_server(server_farm, rserver) def test_create_probe(self): self.driver.create_probe(probe) def test_create_probe_tcp(self): self.driver.create_probe(probe_tcp) def test_create_probe_https(self): self.driver.create_probe(probe_https) def test_delete_probe(self): self.driver.delete_probe(probe_tcp) def test_create_server_farm_with_round_robin(self): self.driver.create_server_farm(server_farm, predictor) def test_create_server_farm_with_leastconnections(self): self.driver.create_server_farm(server_farm, predictor_leastconnections) def test_create_server_farm_with_hashaddr(self): self.driver.create_server_farm(server_farm, predictor_hashaddr) def test_create_server_farm_with_hashurl(self): self.driver.create_server_farm(server_farm, predictor_hashurl) def test_delete_server_farm(self): self.driver.delete_server_farm(server_farm) def test_add_real_server_to_server_farm(self): self.driver.add_real_server_to_server_farm(server_farm, rserver) def test_delete_real_server_from_server_farm(self): self.driver.delete_real_server_from_server_farm(server_farm, rserver) def test_create_virtual_ip(self): self.driver.create_virtual_ip(virtualserver, server_farm) def test_delete_virtual_ip(self): self.driver.delete_virtual_ip(virtualserver)