Exemple #1
0
 def test_wsgi_server(self):
     config_path = os.path.join(self.colpath, "config")
     parser = RawConfigParser()
     parser.read_dict(configuration_to_dict(self.configuration))
     with open(config_path, "w") as f:
         parser.write(f)
     env = os.environ.copy()
     env["PYTHONPATH"] = os.pathsep.join(sys.path)
     env["RADICALE_CONFIG"] = config_path
     p = subprocess.Popen([
         sys.executable, "-m", "waitress", "--listen",
         self.configuration.get_raw("server", "hosts"),
         "radicale:application"
     ],
                          env=env)
     try:
         self.get("/", is_alive_fn=lambda: p.poll() is None, check=302)
     finally:
         p.terminate()
         p.wait()
Exemple #2
0
 def test_wsgi_server(self):
     config_path = os.path.join(self.colpath, "config")
     parser = RawConfigParser()
     parser.read_dict(configuration_to_dict(self.configuration))
     with open(config_path, "w") as f:
         parser.write(f)
     env = os.environ.copy()
     env["PYTHONPATH"] = os.pathsep.join(sys.path)
     p = subprocess.Popen([
         sys.executable, "-c",
         "from gunicorn.app.wsgiapp import run; run()", "--bind",
         self.configuration.get_raw("server", "hosts"), "--env",
         "RADICALE_CONFIG=%s" % config_path, "radicale"
     ],
                          env=env)
     try:
         self.get("/", is_alive_fn=lambda: p.poll() is None, check=302)
     finally:
         p.terminate()
         p.wait()
     assert p.returncode == 0
Exemple #3
0
 def test_load_full(self):
     config_path = self._write_config(configuration_to_dict(config.load()),
                                      "config")
     config.load([(config_path, False)])