예제 #1
0
 def test_save_full_with_https(self):
     defaults = tutor_config.load_defaults()
     with tempfile.TemporaryDirectory() as root:
         config = tutor_config.load_current(root, defaults)
         tutor_config.merge(config, defaults)
         config["ACTIVATE_HTTPS"] = True
         with unittest.mock.patch.object(fmt, "STDOUT"):
             env.save(root, config)
             with open(os.path.join(root, "env", "apps", "nginx", "lms.conf")) as f:
                 self.assertIn("ssl", f.read())
예제 #2
0
파일: test_env.py 프로젝트: wey-gu/tutor
 def test_save_full(self) -> None:
     defaults = tutor_config.load_defaults()
     with tempfile.TemporaryDirectory() as root:
         config = tutor_config.load_current(root, defaults)
         tutor_config.merge(config, defaults)
         with patch.object(fmt, "STDOUT"):
             env.save(root, config)
         self.assertTrue(
             os.path.exists(
                 os.path.join(root, "env", "local", "docker-compose.yml")))
예제 #3
0
파일: test_env.py 프로젝트: yanus/tutor
 def test_save_full_with_https(self):
     defaults = tutor_config.load_defaults()
     with tempfile.TemporaryDirectory() as root:
         config = tutor_config.load_current(root, defaults)
         tutor_config.merge(config, defaults)
         config["ENABLE_HTTPS"] = True
         with unittest.mock.patch.object(fmt, "STDOUT"):
             env.save(root, config)
             with open(os.path.join(root, "env", "apps", "caddy", "Caddyfile")) as f:
                 self.assertIn("www.myopenedx.com {", f.read())