Beispiel #1
0
def test_next_id_overflow():
    try:
        prev_id = "9999"
        next_id = lex_id.next_id(prev_id)
        assert False, (prev_id, "->", next_id)
    except OverflowError:
        pass
Beispiel #2
0
def test_next_id_random():
    for i in range(1000):
        prev_id = str(random.randint(1, 100000))
        try:
            next_id = lex_id.next_id(prev_id)
            assert prev_id < next_id
        except OverflowError:
            assert len(prev_id) == prev_id.count("9")
Beispiel #3
0
def test_next_id_basic():
    assert lex_id.next_id("01") == "02"
    assert lex_id.next_id("09") == "110"