File: test_auth.py

package info (click to toggle)
python-bottle 0.12.7-1%2Bdeb8u2
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 1,568 kB
  • ctags: 2,288
  • sloc: python: 5,711; makefile: 68; sh: 62
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"')