mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
apache: fix AUGEAS_LENS_DIR, add test that it exists
This commit is contained in:
parent
88034a0baf
commit
15e404948e
2 changed files with 16 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
Loading…
Reference in a new issue