summaryrefslogtreecommitdiff
path: root/tests/test_utils.py
diff options
context:
space:
mode:
authorJosé Padilla <jpadilla@webapplicate.com>2019-10-21 22:38:34 -0400
committerGitHub <noreply@github.com>2019-10-21 22:38:34 -0400
commit11ac89474b1179925c76450fcc4b3d2042c45f19 (patch)
treedda6b15326cab750f5e52ee57e3125bb5d0a7eee /tests/test_utils.py
parentae080f472c913ad94456fd9e10b05ec2d038b7cc (diff)
downloadpyjwt-11ac89474b1179925c76450fcc4b3d2042c45f19.tar.gz
DX Tweaks (#450)
* Setup pre-commit hooks * Run initial `tox -e lint` * Fix package name * Fix .travis.yml
Diffstat (limited to 'tests/test_utils.py')
-rw-r--r--tests/test_utils.py45
1 files changed, 27 insertions, 18 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 1408af2..cb73c52 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -1,30 +1,39 @@
+import pytest
+
from jwt.utils import (
- force_bytes, force_unicode, from_base64url_uint, to_base64url_uint
+ force_bytes,
+ force_unicode,
+ from_base64url_uint,
+ to_base64url_uint,
)
-import pytest
-
-@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))
-])
+@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)),
+ ],
+)
def test_to_base64url_uint(inputval, expected):
actual = to_base64url_uint(inputval)
assert actual == expected
-@pytest.mark.parametrize("inputval,expected", [
- (b'AA', 0),
- (b'AQ', 1),
- (b'_w', 255),
- (b'AQAB', 65537),
- (b'B1vNFQ', 123456789, ),
-])
+@pytest.mark.parametrize(
+ "inputval,expected",
+ [
+ (b"AA", 0),
+ (b"AQ", 1),
+ (b"_w", 255),
+ (b"AQAB", 65537),
+ (b"B1vNFQ", 123456789),
+ ],
+)
def test_from_base64url_uint(inputval, expected):
actual = from_base64url_uint(inputval)
assert actual == expected