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

test_explainshell   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 13
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A ExplainShellTest.testExplainShell() 0 11 1
1
"""
2
Tests for the Marvin Explain Shell action
3
"""
4
5
from test_action import ActionTest
6
from irc2phpbb import marvin_actions
7
8
class ExplainShellTest(ActionTest):
9
    """Tests for the Marvin Explain Shell action"""
10
    def testExplainShell(self):
11
        """Test that marvin can explain shell commands"""
12
        url = "https://explainshell.com/explain?cmd=pwd"
13
        self.assertActionOutput(marvin_actions.marvinExplainShell, "explain pwd", url)
14
        self.assertActionOutput(marvin_actions.marvinExplainShell, "can you explain pwd", url)
15
        self.assertActionOutput(
16
            marvin_actions.marvinExplainShell,
17
            "förklara pwd|grep -o $user",
18
            f"{url}%7Cgrep+-o+%24user")
19
20
        self.assertActionSilent(marvin_actions.marvinExplainShell, "explains")
21