apache: fix AUGEAS_LENS_DIR, add test that it exists

This commit is contained in:
Will Greenberg 2026-03-17 14:20:44 -07:00
parent 88034a0baf
commit 15e404948e
2 changed files with 16 additions and 1 deletions

View file

@ -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()

View file

@ -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