File: test_utils.py

package info (click to toggle)
python-httpsig 1.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 224 kB
  • sloc: python: 601; makefile: 8
file content (18 lines) | stat: -rwxr-xr-x 520 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python
import os
import sys
import unittest
from httpsig.utils import get_fingerprint

sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))


class TestUtils(unittest.TestCase):

    def test_get_fingerprint(self):
        with open(os.path.join(
                os.path.dirname(__file__), 'rsa_public.pem'), 'r') as k:
            key = k.read()
        fingerprint = get_fingerprint(key)
        self.assertEqual(
            fingerprint, "73:61:a2:21:67:e0:df:be:7e:4b:93:1e:15:98:a5:b7")