Debian Codegraph @

ansible_collections/community/general/tests/unit/plugins/modules/test_apache2_module.py

raw
1 # Copyright (c) Ansible project
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4
5 from __future__ import annotations
6
7 import pytest
8
9 from ansible_collections.community.general.plugins.modules.apache2_module import create_apache_identifier
10
11 REPLACEMENTS = [
12 ("php7.1", "php7_module"),
13 ("php5.6", "php5_module"),
14 ("shib2", "mod_shib"),
15 ("evasive", "evasive20_module"),
16 ("thismoduledoesnotexist", "thismoduledoesnotexist_module"), # the default
17 ]
18
19
20 @pytest.mark.parametrize("replacement", REPLACEMENTS, ids=lambda x: x[0])
21 def test_apache_identifier(replacement):
22 "test the correct replacement of an a2enmod name with an apache2ctl name"
23 assert create_apache_identifier(replacement[0]) == replacement[1]