phi/test/conftest.py
User Identifier 81b81c6a50 Log as root
2020-10-04 14:23:26 +02:00

36 lines
1.0 KiB
Python

import pytest
import phi.ldap.client
# import phi.api.app
@pytest.fixture
def ldap_client():
client = phi.ldap.client.Client(
host='localhost', port=389,
encryption='TLSv1.2', ciphers='HIGH',
validate=False,
# username='uid=phi,ou=Services,dc=unit,dc=macaomilano,dc=org',
# password='phi',
username='cn=root,dc=unit,dc=macaomilano,dc=org',
password='root',
base_dn='dc=unit,dc=macaomilano,dc=org')
client.open()
yield client
client.close()
# @pytest.fixture
# def api_app():
# return phi.api.app.api_app({
# 'ldap': {
# 'host': 'localhost',
# 'port': 389,
# 'encryption': 'TLSv1.2',
# 'ciphers': 'HIGH',
# 'validate': 'False',
# 'username': 'uid=phi,ou=Services,dc=unit,dc=macaomilano,dc=org',
# 'password': 'phi',
# 'base_dn': 'dc=unit,dc=macaomilano,dc=org',
# 'attribute_id': 'uid',
# 'attribute_mail': 'mail'}})