Ejemplo n.º 1
0
def id_gen_usr():
    return idm.id_generator('pp-usr', start_at=101)
Ejemplo n.º 2
0
def id_gen_sec():
    return idm.id_generator('pp-sec', start_at=10001)
Ejemplo n.º 3
0
def test_get_user_ids(arg1, start_of_id, id_gen_usr):
    user_id = id_gen_usr(arg1)
    assert user_id.startswith(start_of_id)
    assert len(user_id) == 36


@mark.parametrize('arg1, start_of_id', [
    (6001, 'pp-sec-006001-'),
    (0, 'pp-sec-006002-'),
    ("Lloyds Bank", 'pp-sec-lloyds'),
    (0, 'pp-sec-006003-'),
])
def test_get_security_ids(arg1, start_of_id, id_gen_sec):
    sec_id = id_gen_sec(arg1)
    assert sec_id.startswith(start_of_id)
    assert len(sec_id) == 36


def test_get_sequential_id():
    pass

if __name__ == '__main__':
    print("Starting...\n")

    id_gen_usr = idm.id_generator('pp-usr', start_at=101)
    print(id_gen_usr(0))
    print(id_gen_usr(5001))
    print(id_gen_usr(0))

##    test_get_user_ids(0, 'pp-usr-000101-')
    print("\nFinished.")