%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/11585/root/usr/lib/python3/dist-packages/certbot_apache/tests/ |
Upload File : |
"""Test for certbot_apache.entrypoint for override class resolution""" import unittest import mock from certbot_apache import configurator from certbot_apache import entrypoint class EntryPointTest(unittest.TestCase): """Entrypoint tests""" _multiprocess_can_split_ = True def test_get_configurator(self): with mock.patch("certbot.util.get_os_info") as mock_info: for distro in entrypoint.OVERRIDE_CLASSES.keys(): mock_info.return_value = (distro, "whatever") self.assertEqual(entrypoint.get_configurator(), entrypoint.OVERRIDE_CLASSES[distro]) def test_nonexistent_like(self): with mock.patch("certbot.util.get_os_info") as mock_info: mock_info.return_value = ("nonexistent", "irrelevant") with mock.patch("certbot.util.get_systemd_os_like") as mock_like: for like in entrypoint.OVERRIDE_CLASSES.keys(): mock_like.return_value = [like] self.assertEqual(entrypoint.get_configurator(), entrypoint.OVERRIDE_CLASSES[like]) def test_nonexistent_generic(self): with mock.patch("certbot.util.get_os_info") as mock_info: mock_info.return_value = ("nonexistent", "irrelevant") with mock.patch("certbot.util.get_systemd_os_like") as mock_like: mock_like.return_value = ["unknonwn"] self.assertEqual(entrypoint.get_configurator(), configurator.ApacheConfigurator) if __name__ == "__main__": unittest.main() # pragma: no cover