Skip to content

Commit

Permalink
Add simple LDAP test
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Sep 13, 2016
1 parent 0959a16 commit df3b6ff
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ hypothesis>=3.1
pytest
pytest-localserver
pytest-subtesthack
mockldap
25 changes: 25 additions & 0 deletions tests/storage/test_ldap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-

from mockldap import MockLdap
import pytest

from vdirsyncer.storage.ldap import LDAPStorage

from . import StorageTests


class TestLDAPStorage(StorageTests):
storage_class = LDAPStorage
supports_collections = False

@pytest.fixture
def get_storage_args(self, request):
uri = 'ldap://localhost'
mockldap = MockLdap({})
mockldap.start()
ldapobj = mockldap[uri]
request.addfinalizer(mockldap.stop)

def inner(collection='test'):
return {'uri': uri}
return inner

0 comments on commit df3b6ff

Please sign in to comment.