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.

TestRefreshCommandArgs   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
c 4
b 0
f 0
dl 0
loc 30
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A test_for_more_flags() 0 6 1
A test_for_size() 0 9 1
A test_config_overwrite() 0 8 1
1
"""This module is to test the refresh commands plugin."""
2
3
import sys
4
5
from unittest import TestCase
6
7
REFRESH_COMMANDS = sys.modules["Rainmeter.refreshcommands"]
8
9
10
class TestRefreshCommandArgs(TestCase):
11
    """Test class wrapper using unittest."""
12
13
    # pylint: disable=W0703; This is acceptable since we are testing it not failing
14
15
    def test_for_more_flags(self):
16
        """Calling from an inc file should result in less call flags."""
17
        shorter = REFRESH_COMMANDS.calculate_refresh_commands("Rainmeter.exe", "test-config", "file.inc", True, False)
18
        longer = REFRESH_COMMANDS.calculate_refresh_commands("Rainmeter.exe", "test-config", "file.ini", True, True)
19
20
        self.assertGreater(longer, shorter)
21
22
    def test_for_size(self):
23
        """Calling an inc file should matter only by one argument.
24
25
        It is missing the file name since we cannot directly refresh the inc file."""
26
27
        inc = REFRESH_COMMANDS.calculate_refresh_commands("Rainmeter.exe", "test-config", "file.inc", True, False)
28
        ini = REFRESH_COMMANDS.calculate_refresh_commands("Rainmeter.exe", "test-config", "file.ini", True, True)
29
30
        self.assertEqual(len(inc) + 1, len(ini))
31
32
    def test_config_overwrite(self):
33
        """If the config option is not activated we force it 
34
35
        We set True for the ini file to append the file thus resulting in the same result."""
36
        inc = REFRESH_COMMANDS.calculate_refresh_commands("Rainmeter.exe", "test-config", "file.inc", False, True)
37
        ini = REFRESH_COMMANDS.calculate_refresh_commands("Rainmeter.exe", "test-config", "file.ini", False, True)
38
39
        self.assertEquals(inc, ini)
40