def create_user(config, index, role, user, description): # type: (LocalConfig, Index, str, str, str) -> None """ Create a User """ password = gen_password(12) index.users.create_user(user, password, role, description=description) click.echo('{host}:{port}:*:{username}:{password}'.format( host=config.db_hostname or 'localhost', port=config.db_port, username=user, password=password))
def test_gen_pass(n_bytes): password1 = gen_password(n_bytes) password2 = gen_password(n_bytes) assert len(password1) >= n_bytes assert len(password2) >= n_bytes assert password1 != password2