Esempio n. 1
0
def test_distromappings(initialized_mappings):
    c7 = DistroNamespace(name='centos', version='7', like_distro='rhel')
    assert c7.mapped_names() == []
    assert c7.like_namespace_names == ['rhel:7']

    r7 = DistroNamespace(name='rhel', version='7', like_distro='rhel')
    assert set(r7.mapped_names()) == {'centos', 'fedora', 'rhel'}
    assert r7.like_namespace_names == ['rhel:7']

    assert sorted(DistroMapping.distros_mapped_to('rhel', '7')) == sorted([
        DistroTuple('rhel', '7', 'RHEL'),
        DistroTuple('centos', '7', 'RHEL'),
        DistroTuple('fedora', '7', 'RHEL')
    ])
def test_distromappings(initialized_mappings):
    c7 = DistroNamespace(name="centos", version="7", like_distro="rhel")
    assert c7.mapped_names() == []
    assert c7.like_namespace_names == ["rhel:7"]

    r7 = DistroNamespace(name="rhel", version="7", like_distro="rhel")
    assert set(r7.mapped_names()) == {"centos", "fedora", "rhel", "redhat"}
    assert r7.like_namespace_names == ["rhel:7"]

    assert sorted(DistroMapping.distros_mapped_to("rhel", "7")) == sorted([
        DistroTuple("redhat", "7", "RHEL"),
        DistroTuple("rhel", "7", "RHEL"),
        DistroTuple("centos", "7", "RHEL"),
        DistroTuple("fedora", "7", "RHEL"),
    ])