TestShortHash   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 9
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_different() 0 2 1
A test_hashing() 0 4 1
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
4
"""
5
Unit tests for general utility functions.
6
"""
7
8
import unittest
9
from .. import utils
10
11
class TestShortHash(unittest.TestCase):
12
13
    def test_different(self):
14
        self.assertNotEqual(utils.short_hash(True), utils.short_hash(False))
15
16
    def test_hashing(self):
17
        # So that it does not change with time and break old hashes.
18
        self.assertEqual("7fc56270e79d5ed678fe0d61f8370cf623e75af33a3ea00cfc",
19
            utils.short_hash("ABCDE"))