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)
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)
def setUp(self): self.slapd = Slapd() self.slapd.__enter__()