File: test_request_asgi.py

package info (click to toggle)
python-falcon 4.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,172 kB
  • sloc: python: 33,608; javascript: 92; sh: 50; makefile: 50
file content (21 lines) | stat: -rw-r--r-- 491 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import pytest

from falcon import testing


def test_missing_server_in_scope():
    req = testing.create_asgi_req(include_server=False, http_version='1.0')
    assert req.host == 'localhost'
    assert req.port == 80


def test_log_error_not_supported():
    req = testing.create_asgi_req()
    with pytest.raises(NotImplementedError):
        req.log_error('Boink')


def test_env_not_supported():
    req = testing.create_asgi_req()
    with pytest.raises(AttributeError):
        req.env