File: test_importer.py

package info (click to toggle)
cloud-init 25.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,412 kB
  • sloc: python: 135,894; sh: 3,883; makefile: 141; javascript: 30; xml: 22
file content (24 lines) | stat: -rw-r--r-- 706 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pytest

from cloudinit.importer import match_case_insensitive_module_name


@pytest.mark.parametrize(
    "m_name,m_match",
    (
        pytest.param(
            "nocloud-net",
            "DataSourceNoCloud",
            id="nocloud-net is a special case, make sure it works",
        ),
        pytest.param(
            "nocloud",
            "DataSourceNoCloud",
            id="nocloud is a special case, make sure it works",
        ),
        pytest.param("DataSourceGCE", "DataSourceGCE", id="gce, full name"),
        pytest.param("gce", "DataSourceGCE", id="gce, name match"),
    ),
)
def test_importer(m_name, m_match):
    assert m_match == match_case_insensitive_module_name(m_name)