def setUp(self): os.environ["REDIS_IMAGE"] = "redisapi" self.addCleanup(self.remove_env, "REDIS_IMAGE") os.environ["DOCKER_HOSTS"] = '["http://host1.com:4243", \ "http://localhost:4243", "http://host2.com:4243"]' self.addCleanup(self.remove_env, "DOCKER_HOSTS") os.environ["SENTINEL_HOSTS"] = '["http://host1.com:4243", \ "http://localhost:4243", "http://host2.com:4243"]' self.addCleanup(self.remove_env, "SENTINEL_HOSTS") self.manager = DockerHaManager() self.storage = MongoStorage()
def test_client(self): manager = DockerHaManager() client = manager.client(host="myhost") self.assertIn(client.base_url, "myhost")