Exemple #1
0
 def test_root_no_trailing_slash(self):
     from certbot_apache._internal.parser import ApacheParser
     with mock.patch("certbot_apache._internal.parser.ApacheParser."
                     "update_runtime_variables"):
         parser = ApacheParser(self.config_path + os.path.sep, self.config,
                               "/dummy/vhostpath")
     self.assertEqual(parser.root, self.config_path)
Exemple #2
0
    def test_root_absolute(self):
        from certbot_apache._internal.parser import ApacheParser
        with mock.patch("certbot_apache._internal.parser.ApacheParser."
                        "update_runtime_variables"):
            parser = ApacheParser(os.path.relpath(self.config_path),
                                  self.config, "/dummy/vhostpath")

        self.assertEqual(parser.root, self.config_path)
Exemple #3
0
    def setUp(self, test_dir="debian_apache_2_4/multiple_vhosts",
              config_root="debian_apache_2_4/multiple_vhosts/apache2",
              vhost_root="debian_apache_2_4/multiple_vhosts/apache2/sites-available"):
        super().setUp(test_dir, config_root, vhost_root)

        from certbot_apache._internal.parser import ApacheParser
        self.aug = augeas.Augeas(
            flags=augeas.Augeas.NONE | augeas.Augeas.NO_MODL_AUTOLOAD)
        with mock.patch("certbot_apache._internal.parser.ApacheParser."
                        "update_runtime_variables"):
            self.parser = ApacheParser(
                self.config_path, self.vhost_path, configurator=self.config)
Exemple #4
0
    def test_root_normalized(self):
        from certbot_apache._internal.parser import ApacheParser

        with mock.patch("certbot_apache._internal.parser.ApacheParser."
                        "update_runtime_variables"):
            path = os.path.join(
                self.temp_dir,
                "debian_apache_2_4/////multiple_vhosts/../multiple_vhosts/apache2"
            )

            parser = ApacheParser(path, self.config, "/dummy/vhostpath")

        self.assertEqual(parser.root, self.config_path)
Exemple #5
0
    def setUp(self, test_dir="debian_apache_2_4/multiple_vhosts",
              config_root="debian_apache_2_4/multiple_vhosts/apache2",
              vhost_root="debian_apache_2_4/multiple_vhosts/apache2/sites-available"):
        super(ParserTest, self).setUp(test_dir, config_root, vhost_root)

        zope.component.provideUtility(display_util.FileDisplay(sys.stdout,
                                                               False))

        from certbot_apache._internal.parser import ApacheParser
        self.aug = augeas.Augeas(
            flags=augeas.Augeas.NONE | augeas.Augeas.NO_MODL_AUTOLOAD)
        with mock.patch("certbot_apache._internal.parser.ApacheParser."
                        "update_runtime_variables"):
            self.parser = ApacheParser(
                self.config_path, self.vhost_path, configurator=self.config)