예제 #1
0
def test_revid():
    v = revid()
    assert len(v) == REVID_LENGTH
    print(v)
예제 #2
0
def test_start_end():
    assert revid(EPOCH_START) == '0' * (REVID_LENGTH - 1) + '1'
    assert revid(EPOCH_END) == '1' + '0' * REVID_LENGTH
예제 #3
0
def test_range():
    with pytest.raises(ValueError):
        revid(EPOCH_START - timedelta.resolution)

    with pytest.raises(ValueError):
        revid(EPOCH_END + timedelta.resolution)