class TestWebAuthMiddleware(WebTestCase): def setUp(self): self.wa = WebAuth(app_root, test_config, 'web.auth.') def test_exceptions(self): self.assertRaises(Exception, lambda: WebAuth(None)) def test_get_method_null(self): self.assertEqual(self.wa.get_method(''), None) def test_get_method_shallow(self): foo = self.wa.get_method('web.core.application:Application') self.assertTrue(isinstance(foo(app_root), web.core.Application)) def test_get_method_deep(self): foo = self.wa.get_method('web.core.application:Application.factory') foo(dict(), app_root)
def setUp(self): self.wa = WebAuth(app_root, test_config, 'web.auth.')