OXIESEC PANEL
- Current Dir:
/
/
snap
/
certbot
/
4730
/
lib
/
python3.12
/
site-packages
/
certbot_apache
/
_internal
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/10/2025 09:51:14 PM
rwxr-xr-x
📄
__init__.py
27 bytes
06/10/2025 09:51:04 PM
rw-r--r--
📁
__pycache__
-
06/10/2025 09:51:14 PM
rwxr-xr-x
📄
augeasnode_test.py
12.64 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
autohsts_test.py
8.73 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
centos_test.py
10.71 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
complex_parsing_test.py
4.3 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
configurator_reverter_test.py
2.75 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
configurator_test.py
75.82 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
debian_test.py
9.07 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
display_ops_test.py
3.66 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
dualnode_test.py
23.52 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
entrypoint_test.py
1.68 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
fedora_test.py
7.97 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
gentoo_test.py
5.46 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
http_01_test.py
8.97 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
obj_test.py
5.04 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
parser_test.py
16.3 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
parsernode_configurator_test.py
1.59 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
parsernode_test.py
3.47 KB
06/10/2025 09:51:04 PM
rw-r--r--
📄
parsernode_util_test.py
3.2 KB
06/10/2025 09:51:04 PM
rw-r--r--
📁
testdata
-
06/10/2025 09:51:14 PM
rwxr-xr-x
📄
util.py
10.88 KB
06/10/2025 09:51:04 PM
rw-r--r--
Editing: entrypoint_test.py
Close
"""Test for certbot_apache._internal.entrypoint for override class resolution""" import sys from unittest import mock import pytest from certbot_apache._internal import configurator from certbot_apache._internal import entrypoint def test_get_configurator(): with mock.patch("certbot.util.get_os_info") as mock_info: for distro in entrypoint.OVERRIDE_CLASSES: return_value = (distro, "whatever") if distro == 'fedora_old': return_value = ('fedora', '28') elif distro == 'fedora': return_value = ('fedora', '29') mock_info.return_value = return_value assert entrypoint.get_configurator() == \ entrypoint.OVERRIDE_CLASSES[distro] def test_nonexistent_like(): 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: mock_like.return_value = [like] assert entrypoint.get_configurator() == \ entrypoint.OVERRIDE_CLASSES[like] def test_nonexistent_generic(): 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 = ["unknown"] assert entrypoint.get_configurator() == \ configurator.ApacheConfigurator if __name__ == "__main__": sys.exit(pytest.main(sys.argv[1:] + [__file__])) # pragma: no cover