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.test_first_longer_equal_one()   A

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
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