GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 844209...95deb7 )
by thatsIch
59s
created

TestLevenShtein   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 37
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A test_zero_words_should_zero() 0 7 1
A test_same_word_should_zero() 0 7 1
A test_first_longer_equal_one() 0 7 1
A test_second_longer_equal_one() 0 8 1
1
import sys
2
3
from unittest import TestCase
4
5
levenshtein = sys.modules["Rainmeter.completion.levenshtein"]
6
7
8
class TestLevenShtein(TestCase):
9
    """
10
    Test for the levenshtein module
11
    """
12
13
    def test_same_word_should_zero(self):
14
        """
15
        if we use the same word there should be no difference required
16
        """
17
        diff = levenshtein.levenshtein("hello", "hello")
18
19
        self.assertEqual(diff, 0)
20
21
    def test_zero_words_should_zero(self):
22
        """
23
        special case with same word but both are empty
24
        """
25
        diff = levenshtein.levenshtein("", "")
26
27
        self.assertEqual(diff, 0)
28
29
    def test_first_longer_equal_one(self):
30
        """
31
        try with same word base but missing characters
32
        """
33
        diff = levenshtein.levenshtein("hello", "hell")
34
35
        self.assertEqual(diff, 1)
36
37
    def test_second_longer_equal_one(self):
38
        """
39
        reversed case of the missing character.
40
        method should work in both ways and not return a negative difference
41
        """
42
        diff = levenshtein.levenshtein("hell", "hello")
43
44
        self.assertEqual(diff, 1)
45