File: test_auth.py

package info (click to toggle)
python-bottle 0.12.15-2%2Bdeb10u2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,532 kB
  • sloc: python: 5,791; makefile: 68; sh: 63
file content (12 lines) | stat: -rw-r--r-- 344 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
# -*- coding: utf-8 -*-
import bottle
from tools import ServerTestBase

class TestBasicAuth(ServerTestBase):

    def test__header(self):
        @bottle.route('/')
        @bottle.auth_basic(lambda x, y: False)
        def test(): return {}
        self.assertStatus(401)
        self.assertHeader('Www-Authenticate', 'Basic realm="private"')