def test_check_auth(self): # get our modules modconf.passwd = 'libexec/htpasswd.users' mod = passwd_ui.get_instance(modconf) sl = get_instance(mod) # Hack here :( sl.properties = {} sl.properties['to_queue'] = None sl.init() # Now call the real stuff :) r = sl.check_auth('toto', 'titi') self.assertFalse(r) r = sl.check_auth('admin', 'foobar') self.assertTrue(r)
def test_memcache_retention(self): print self.conf.modules #get our modules modconf.passwd = 'libexec/htpasswd.users' mod = passwd_ui.get_instance(modconf) sl = get_instance(mod) print "Instance", sl #Hack here :( sl.properties = {} sl.properties['to_queue'] = None sl.init() l = logger # Now call the real stuff :) r = sl.check_auth('toto', 'titi') print "RES", r self.assert_(not r) r = sl.check_auth('admin', 'foobar') print "RES", r self.assert_(r)