Exemplo n.º 1
0
def test_bump_final():
    cur_version = "v201712.0001"
    assert cur_version < version.incr(cur_version)
    assert version.incr(cur_version).endswith(".0002")
    assert version.incr(cur_version, release="alpha").endswith("-alpha")

    assert version.incr(cur_version, release="final").endswith(".0002")

    pre_version = cur_version + "-beta"
    assert version.incr(pre_version, release="final").endswith(".0002")
Exemplo n.º 2
0
def test_bump_future():
    """Test that versions don't go back in time."""
    future_date = dt.datetime.today() + dt.timedelta(days=300)
    future_calver = future_date.strftime("v%Y%m")
    cur_version = future_calver + ".0001"
    new_version = version.incr(cur_version)
    assert cur_version < new_version
Exemplo n.º 3
0
def test_bump_random(monkeypatch):
    cur_date = dt.date(2016, 1, 1) + dt.timedelta(days=random.randint(1, 2000))
    cur_version = cur_date.strftime("v%Y%m") + ".0001-dev"

    monkeypatch.setattr(version, 'TODAY', cur_date)

    for i in range(1000):
        cur_date += dt.timedelta(days=int((1 + random.random())**10))
        new_version = version.incr(cur_version,
                                   release=random.choice([
                                       None, "alpha", "beta", "rc", "final",
                                       "post"
                                   ]))
        assert cur_version < new_version
        cur_version = new_version
Exemplo n.º 4
0
def test_bump_beta():
    cur_version = "v201712.0001-beta"
    assert cur_version < version.incr(cur_version)
    assert version.incr(cur_version).endswith("-beta")
    assert version.incr(cur_version, release="alpha").endswith("-alpha")
    assert version.incr(cur_version, release="final").endswith("0002")