Debian Codegraph @

ansible_collections/community/dns/tests/unit/plugins/module_utils/test__argspec.py

raw
1 # Copyright (c) 2021, Felix Fontein <[email protected]>
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 from ansible_collections.community.dns.plugins.module_utils._argspec import ArgumentSpec
8
9
10 def test_argspec():
11 empty = ArgumentSpec()
12 non_empty = ArgumentSpec(
13 argument_spec={"test": {"type": "str"}, "foo": {}},
14 required_together=[("test", "foo")],
15 required_if=[("test", "bar", ["foo"])],
16 required_one_of=[("test", "foo")],
17 mutually_exclusive=[("test", "foo")],
18 )
19 empty.merge(non_empty)
20 assert empty.to_kwargs() == non_empty.to_kwargs()