File: test_utils.py

package info (click to toggle)
python-jose 3.3.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 528 kB
  • sloc: python: 4,020; makefile: 162; sh: 6
file content (14 lines) | stat: -rw-r--r-- 372 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from datetime import timedelta

from jose import utils


class TestUtils:
    def test_total_seconds(self):
        td = timedelta(seconds=5)

        assert utils.timedelta_total_seconds(td) == 5

    def test_long_to_base64(self):
        assert utils.long_to_base64(0xDEADBEEF) == b"3q2-7w"
        assert utils.long_to_base64(0xCAFED00D, size=10) == b"AAAAAAAAyv7QDQ"