Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins committed Mar 21, 2021
1 parent df5f0e0 commit f9bb218
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,27 @@ def test_request_id_defaults_uuid():
assert request.id == request.id == request._id


def test_name_none():
request = Request(b"/", {}, None, "GET", None, None)

assert request.name is None


def test_name_from_route():
request = Request(b"/", {}, None, "GET", None, None)
route = Mock()
request.route = route

assert request.name == route.name


def test_name_from_set():
request = Request(b"/", {}, None, "GET", None, None)
request._name = "foo"

assert request.name == "foo"


@pytest.mark.parametrize(
"request_id,expected_type",
(
Expand Down

0 comments on commit f9bb218

Please sign in to comment.