Debian Codegraph @

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

raw
1 # Copyright (c) 2022, 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 import pytest
8
9 from ansible_collections.community.dns.plugins.module_utils._provider import ensure_type
10
11 CHECK_TYPE_DATA = [
12 ("asdf", "str", "asdf"),
13 (1, "str", "1"),
14 ([], "list", []),
15 ({}, "dict", {}),
16 ("yes", "bool", True),
17 ("5", "int", 5),
18 ("5.10", "float", 5.10),
19 ("foobar", "raw", "foobar"),
20 ]
21
22
23 @pytest.mark.parametrize("input_string, type_name, output", CHECK_TYPE_DATA)
24 def test_is_ascii_label(input_string, type_name, output):
25 assert ensure_type(input_string, type_name) == output