Пример #1
0
class TestCase(unittest.TestCase):
    # XXX: zope testrunner ignores setUpClass and setUpModule?!
    # Well, slapd is not expensive and there are not many tests, yet...
    #@classmethod
    #def setUpClass(cls):
    def setUp(self):
        self.slapd = Slapd()
        self.slapd.__enter__()

    # @classmethod
    # def tearDownClass(cls):
    def tearDown(self):
        self.slapd.__exit__()

    def test_(self):
        plugin = Plugin()

        auth = plugin.authenticateCredentials(dict(login='******', password='******'))
        self.assertIsNone(auth)

        auth = plugin.authenticateCredentials(dict(login='******', password='******'))
        self.assertIsNotNone(auth)
Пример #2
0
class TestCase(unittest.TestCase):
    # XXX: zope testrunner ignores setUpClass and setUpModule?!
    # Well, slapd is not expensive and there are not many tests, yet...
    #@classmethod
    #def setUpClass(cls):
    def setUp(self):
        self.slapd = Slapd()
        self.slapd.__enter__()

    # @classmethod
    # def tearDownClass(cls):
    def tearDown(self):
        self.slapd.__exit__()

    def test_(self):
        plugin = Plugin()

        auth = plugin.authenticateCredentials(
            dict(login='******', password='******'))
        self.assertIsNone(auth)

        auth = plugin.authenticateCredentials(dict(login='******',
                                                   password='******'))
        self.assertIsNotNone(auth)
Пример #3
0
 def setUp(self):
     self.slapd = Slapd()
     self.slapd.__enter__()
Пример #4
0
 def setUp(self):
     self.slapd = Slapd()
     self.slapd.__enter__()