Ejemplo n.º 1
0
def test_parse_apt_lines(params):
    """Calling parse_apt_line with multiple lines and ensure that the result is the expected one."""
    group, package = cli.parse_apt_line(APT_HOOK_LINES[params[0]][params[1]],
                                        mocked_apt.cache.Cache(),
                                        version=params[0])
    assert group == params[2]
    if params[3] is None:
        assert package is None
    else:
        assert package['name'] == params[3]
        assert package['version'] == params[4]
Ejemplo n.º 2
0
def test_parse_apt_line_wrong_version():
    """Calling parse_apt_line with the wrong version should raise RuntimeError."""
    with pytest.raises(RuntimeError, match='Unsupported version'):
        cli.parse_apt_line('line', None, version=1)