You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use fakeldap library with a simple example.
test_base.py
import unittest
from mock import patch
from fakeldap import MockLDAP
_mock_ldap = MockLDAP()
ldap_server = 'ldaps://myldapserver'
class BaseTests(unittest.TestCase):
def setUp(self):
# Patch where the ldap library is used:
self.ldap_patcher = patch(ldap_server)
self.mock_ldap = self.ldap_patcher.start()
self.mock_ldap.return_value = _mock_ldap
def tearDown(self):
_mock_ldap.reset()
self.mock_ldap.stop()
Dependencies:
python-mock-1.0.1
When I execute: python test_base.py
It raises this error:
self.mock_ldap = self.ldap_patcher.start()
File "/usr/lib/python2.6/site-packages/mock-1.0.1-py2.6.egg/mock.py", line 1396, in start
result = self.__enter__()
File "/usr/lib/python2.6/site-packages/mock-1.0.1-py2.6.egg/mock.py", line 1252, in __enter__
self.target = self.getter()
File "/usr/lib/python2.6/site-packages/mock-1.0.1-py2.6.egg/mock.py", line 1414, in <lambda>
getter = lambda: _importer(target)
File "/usr/lib/python2.6/site-packages/mock-1.0.1-py2.6.egg/mock.py", line 1098, in _importer
thing = __import__(import_path)
ImportError: Import by filename is not supported.
The text was updated successfully, but these errors were encountered:
I'm trying to use fakeldap library with a simple example.
test_base.py
Dependencies:
When I execute: python test_base.py
It raises this error:
The text was updated successfully, but these errors were encountered: