Ejemplo n.º 1
0
def test_eol_date_unknown(pyvinfo: CPythonVersionInfo, v: str) -> None:
    with pytest.raises(UnknownVersionError) as excinfo:
        pyvinfo.eol_date(v)
    assert str(excinfo.value) == f"Unknown version: {v!r}"
    assert excinfo.value.version == v
Ejemplo n.º 2
0
def test_eol_date_recent(mocker: MockerFixture, pyvinfo: CPythonVersionInfo) -> None:
    mocker.patch("time.time", return_value=1635992101)
    assert pyvinfo.eol_date("2") == date(2020, 1, 1)
Ejemplo n.º 3
0
def test_eol_date_invalid(pyvinfo: CPythonVersionInfo, v: str) -> None:
    with pytest.raises(ValueError) as excinfo:
        pyvinfo.eol_date(v)
    assert str(excinfo.value) == f"Invalid version string: {v!r}"
Ejemplo n.º 4
0
def test_eol_date(
    pyvinfo: CPythonVersionInfo, version: str, eol: Optional[date]
) -> None:
    assert pyvinfo.eol_date(version) == eol