Test Failed
Pull Request — master (#86)
by Daniel
06:22 queued 03:08
created

test_principle   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 14
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A PrincipleTest.testPrinciple() 0 9 3
1
"""
2
Tests for the Marvin Principle action
3
"""
4
5
from unittest import mock
6
7
from test_action import ActionTest
8
from irc2phpbb import marvin_actions
9
10
class PrincipleTest(ActionTest):
11
    """Tests for the Marvin Principle action"""
12
    def testPrinciple(self):
13
        """Test that marvin can recite some software principles"""
14
        principles = self.strings.get("principle")
15
        for key, value in principles.items():
16
            self.assertActionOutput(marvin_actions.marvinPrinciple, f"princip {key}", value)
17
        with mock.patch("irc2phpbb.marvin_actions.random") as r:
18
            r.choice.return_value = "dry"
19
            self.assertStringsOutput(marvin_actions.marvinPrinciple, "princip", "principle", "dry")
20
        self.assertActionSilent(marvin_actions.marvinPrinciple, "principlös")
21