Skip to content

Commit

Permalink
fix test_utils.py not to xfail
Browse files Browse the repository at this point in the history
  • Loading branch information
pachewise committed Sep 12, 2024
1 parent 467c748 commit c90e0de
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from contextlib import nullcontext
import pytest

from jwt.utils import force_bytes, from_base64url_uint, is_ssh_key, to_base64url_uint
Expand All @@ -6,17 +7,18 @@
@pytest.mark.parametrize(
"inputval,expected",
[
(0, b"AA"),
(1, b"AQ"),
(255, b"_w"),
(65537, b"AQAB"),
(123456789, b"B1vNFQ"),
pytest.param(-1, "", marks=pytest.mark.xfail(raises=ValueError)),
(0, nullcontext(b"AA")),
(1, nullcontext(b"AQ")),
(255, nullcontext(b"_w")),
(65537, nullcontext(b"AQAB")),
(123456789, nullcontext(b"B1vNFQ")),
(-1, pytest.raises(ValueError)),
],
)
def test_to_base64url_uint(inputval, expected):
actual = to_base64url_uint(inputval)
assert actual == expected
with expected as e:
actual = to_base64url_uint(inputval)
assert actual == e


@pytest.mark.parametrize(
Expand Down

0 comments on commit c90e0de

Please sign in to comment.