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.

TestProgramPathProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 34
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A test_overall() 0 10 1
A test_from_registry() 0 10 1
A test_default_path() 0 9 1
1
"""This module is to test the program path provider."""
2
3
import sys
4
5
from unittest import TestCase
6
7
PROGRAM_PATH_PROVIDER = sys.modules["Rainmeter.path.program_path_provider"]
8
9
10
class TestProgramPathProvider(TestCase):
11
    """Need to use a class to extend from TestCase."""
12
13
    def test_default_path(self):
14
        r"""
15
        If the user installed the application into the default directory.
16
17
        it is in "C:/Program Files/Rainmeter"
18
        """
19
        default_program_path = PROGRAM_PATH_PROVIDER.get_rm_path_from_default_path()
20
21
        self.assertEqual(default_program_path, "C:\\Program Files\\Rainmeter")
22
23
    def test_from_registry(self):
24
        r"""
25
        Upon normal installation it will leave a registry entry to detect.
26
27
        We can use this to find the actual Rainmeter.
28
        Since we use the default installation path, there should no difference
29
        """
30
        registry_program_path = PROGRAM_PATH_PROVIDER.get_rm_path_from_registry()
31
32
        self.assertEqual(registry_program_path, "C:\\Program Files\\Rainmeter")
33
34
    def test_overall(self):
35
        r"""
36
        Per default we install it onto "C:/Program Files/Rainmeter".
37
38
        But since we use the path internally we already add / to it
39
        and python internal path uses \\ instead windows /
40
        """
41
        program_path = PROGRAM_PATH_PROVIDER.get_cached_program_path()
42
43
        self.assertEqual(program_path, "C:\\Program Files\\Rainmeter\\")
44