Debian Codegraph @

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

raw
1 # Author: Alexei Znamensky ([email protected])
2 #
3 # Copyright (c) Alexei Znamensky ([email protected])
4 #
5 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
6 # SPDX-License-Identifier: GPL-3.0-or-later
7
8 from __future__ import annotations
9
10 from ansible_collections.community.general.plugins.modules import composer
11
12 from .uthelper import RunCommandMock, TestCaseMock, UTHelper
13
14
15 class OsPathExistsMock(TestCaseMock):
16 name = "os_path_exists"
17
18 def setup(self, mocker):
19 mocker.patch("os.path.exists", return_value=self.mock_specs.get("return_value", False))
20
21 def check(self, test_case, results):
22 pass
23
24
25 UTHelper.from_module(composer, __name__, mocks=[RunCommandMock, OsPathExistsMock])