From 15e404948e17e1c5849b381d0001e875255c53fb Mon Sep 17 00:00:00 2001 From: Will Greenberg Date: Tue, 17 Mar 2026 14:20:44 -0700 Subject: [PATCH] apache: fix AUGEAS_LENS_DIR, add test that it exists --- .../certbot/_internal/plugins/apache/constants.py | 2 +- .../tests/plugins/apache/constants_test.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 certbot/src/certbot/_internal/tests/plugins/apache/constants_test.py diff --git a/certbot/src/certbot/_internal/plugins/apache/constants.py b/certbot/src/certbot/_internal/plugins/apache/constants.py index d6d9f02c7..b37a943b3 100644 --- a/certbot/src/certbot/_internal/plugins/apache/constants.py +++ b/certbot/src/certbot/_internal/plugins/apache/constants.py @@ -45,7 +45,7 @@ def _generate_augeas_lens_dir_static() -> str: file_manager = ExitStack() atexit.register(file_manager.close) augeas_lens_dir_ref = importlib.resources.files("certbot") / "_internal" \ - "plugins" / "apache" / "augeas_lens" + / "plugins" / "apache" / "augeas_lens" return str(file_manager.enter_context(importlib.resources.as_file(augeas_lens_dir_ref))) AUGEAS_LENS_DIR = _generate_augeas_lens_dir_static() diff --git a/certbot/src/certbot/_internal/tests/plugins/apache/constants_test.py b/certbot/src/certbot/_internal/tests/plugins/apache/constants_test.py new file mode 100644 index 000000000..d155b85be --- /dev/null +++ b/certbot/src/certbot/_internal/tests/plugins/apache/constants_test.py @@ -0,0 +1,15 @@ +"""Tests for certbot._internal.plugins.apache.constants""" +import sys +import os.path + +import pytest + +from certbot._internal.plugins.apache import constants + + +def test_augeas_lens_dir_exists(): + assert os.path.exists(constants.AUGEAS_LENS_DIR) + + +if __name__ == "__main__": + sys.exit(pytest.main(sys.argv[1:] + [__file__])) # pragma: no cover