bumpver/test/test_version.py

38 lines
958 B
Python
Raw Normal View History

2018-09-02 21:48:12 +02:00
import datetime as dt
2018-09-03 09:19:27 +02:00
from pycalver import version
2018-09-02 21:48:12 +02:00
2018-09-03 09:19:27 +02:00
def test_current_calver():
v = version.current_calver()
assert len(v) == 7
assert v.startswith("v")
assert v[1:].isdigit()
2018-09-02 21:48:12 +02:00
2018-09-03 09:19:27 +02:00
# def test_calver():
# import random
2018-09-02 21:48:12 +02:00
2018-09-03 09:19:27 +02:00
# first_version_str = "v201808.0001-dev"
# padding = len(first_version_str) + 3
# version_str = first_version_str
2018-09-02 21:48:12 +02:00
2018-09-03 09:19:27 +02:00
# def _current_calver() -> str:
# _current_calver.delta += dt.timedelta(days=int(random.random() * 5))
2018-09-02 21:48:12 +02:00
2018-09-03 09:19:27 +02:00
# return (dt.datetime.utcnow() + _current_calver.delta).strftime("v%Y%m")
2018-09-02 21:48:12 +02:00
2018-09-03 09:19:27 +02:00
# _current_calver.delta = dt.timedelta(days=1)
2018-09-02 21:48:12 +02:00
2018-09-03 09:19:27 +02:00
# global current_calver
# current_calver = _current_calver
# for i in range(1050):
# version_str = incr_version(version_str, tag=random.choice([
# None, "alpha", "beta", "rc"
# ]))
# print(f"{version_str:<{padding}}", end=" ")
# if (i + 1) % 8 == 0:
# print()
# print()