Ejemplo n.º 1
0
def test_get_latest_version_dateless():
    versions = [
        ExtensionVersion(arguments(**{'Date': None})),
        ExtensionVersion(arguments(**{
            'Date': None,
            'Version': '1'
        })),
    ]

    with pytest.raises(UnknownLatestVersion) as excinfo:
        get_latest_version(versions)

    assert str(excinfo.value) == ''
Ejemplo n.º 2
0
def test_get_latest_version_dated():
    versions = [
        ExtensionVersion(arguments(**{'Version': '1'})),
        ExtensionVersion(arguments(**{'Date': None})),
        ExtensionVersion(arguments(**{'Date': '1000-01-01'})),
    ]

    assert get_latest_version(versions).version == '1'
Ejemplo n.º 3
0
def test_get_latest_version_one():
    versions = [
        ExtensionVersion(arguments(**{'Version': '1'})),
    ]

    assert get_latest_version(versions).version == '1'