starlette icon indicating copy to clipboard operation
starlette copied to clipboard

test: add tests in `test_routing`

Open Orenoid opened this issue 1 year ago • 2 comments

Summary

Add tests for some of the uncovered branches in starlette.routing, related to this issue

Checklist

  • [x] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • [x] I've updated the documentation accordingly. (It seems no documentation needs update)

Orenoid avatar Aug 31 '24 08:08 Orenoid

Can you explain me what behavior is being tested?

Kludex avatar Sep 01 '24 06:09 Kludex

Can you explain me what behavior is being tested?

I've provided the code lines above. According to the coverage report, those if statements are always True with the other tests. The tests I added check if the logic can correctly jump to another branch, which should raise an exception in these cases.

Orenoid avatar Sep 01 '24 08:09 Orenoid