Exemplo n.º 1
0
def test_unmarshal_package_repositories_list_ppa():
    test_dict = {"type": "apt", "ppa": "test/foo"}
    test_list = [test_dict]

    unmarshalled_list = [
        repo.marshal()
        for repo in PackageRepository.unmarshal_package_repositories(test_list)
    ]

    assert unmarshalled_list == test_list
Exemplo n.º 2
0
def test_unmarshal_package_repositories_list_apt():
    test_dict = {
        "architectures": ["amd64", "i386"],
        "components": ["main", "multiverse"],
        "formats": ["deb", "deb-src"],
        "key-id": "A" * 40,
        "key-server": "keyserver.ubuntu.com",
        "name": "test-name",
        "suites": ["xenial", "xenial-updates"],
        "type": "apt",
        "url": "http://archive.ubuntu.com/ubuntu",
    }

    test_list = [test_dict]

    unmarshalled_list = [
        repo.marshal()
        for repo in PackageRepository.unmarshal_package_repositories(test_list)
    ]

    assert unmarshalled_list == test_list
Exemplo n.º 3
0
def test_apt_marshal():
    repo = PackageRepositoryApt(
        architectures=["amd64", "i386"],
        components=["main", "multiverse"],
        formats=["deb", "deb-src"],
        key_id="A" * 40,
        key_server="xkeyserver.ubuntu.com",
        name="test-name",
        suites=["xenial", "xenial-updates"],
        url="http://archive.ubuntu.com/ubuntu",
    )

    assert repo.marshal() == {
        "architectures": ["amd64", "i386"],
        "components": ["main", "multiverse"],
        "formats": ["deb", "deb-src"],
        "key-id": "A" * 40,
        "key-server": "xkeyserver.ubuntu.com",
        "name": "test-name",
        "suites": ["xenial", "xenial-updates"],
        "type": "apt",
        "url": "http://archive.ubuntu.com/ubuntu",
    }
Exemplo n.º 4
0
def test_ppa_marshal():
    repo = PackageRepositoryAptPpa(ppa="test/ppa")

    assert repo.marshal() == {"type": "apt", "ppa": "test/ppa"}