Пример #1
0
    def test_handle_fail_no_optional(self):
        # Setup
        auth_framework.REQUIRED_PLUGINS = [fail]
        auth_framework.OPTIONAL_PLUGINS = []

        request = MockRequest()

        # Test
        http_code = auth_framework._handle(request)

        self.assertEqual(auth_framework.apache.HTTP_UNAUTHORIZED, http_code)
Пример #2
0
    def test_handle_no_plugins(self):
        # Setup
        auth_framework.REQUIRED_PLUGINS = []
        auth_framework.OPTIONAL_PLUGINS = []

        request = MockRequest()

        # Test
        http_code = auth_framework._handle(request)

        self.assertEqual(auth_framework.apache.OK, http_code)
Пример #3
0
    def test_handle_pass_required_pass_optional(self):
        # Setup
        auth_framework.REQUIRED_PLUGINS = [win, win]
        auth_framework.OPTIONAL_PLUGINS = [fail, fail, win]

        request = MockRequest()

        # Test
        http_code = auth_framework._handle(request)

        self.assertEqual(auth_framework.apache.OK, http_code)