File: test_response.py

package info (click to toggle)
aiosmtplib 4.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 572 kB
  • sloc: python: 5,516; makefile: 20; sh: 6
file content (16 lines) | stat: -rw-r--r-- 517 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from hypothesis import given
from hypothesis.strategies import integers, text

from aiosmtplib.response import SMTPResponse


@given(integers(), text())
def test_response_repr(code: int, message: str) -> None:
    response = SMTPResponse(code, message)
    assert repr(response) == f"({response.code}, {response.message})"


@given(integers(), text())
def test_response_str(code: int, message: str) -> None:
    response = SMTPResponse(code, message)
    assert str(response) == f"{response.code} {response.message}"