File: test_http_exceptions.py

package info (click to toggle)
python-aiohttp 3.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 5,612 kB
  • sloc: python: 36,917; ansic: 15,734; makefile: 365; sh: 83
file content (20 lines) | stat: -rw-r--r-- 506 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Tests for http_exceptions.py"""

from aiohttp import http_exceptions


def test_bad_status_line1() -> None:
    err = http_exceptions.BadStatusLine(b'')
    assert str(err) == "b''"


def test_bad_status_line2() -> None:
    err = http_exceptions.BadStatusLine('Test')
    assert str(err) == 'Test'


def test_http_error_exception() -> None:
    exc = http_exceptions.HttpProcessingError(
        code=500, message='Internal error')
    assert exc.code == 500
    assert exc.message == 'Internal error'