Test Failed
Pull Request — master (#86)
by Daniel
04:59
created

test_google.GoogleTest.testGoogle()   A

Complexity

Conditions 2

Size

Total Lines 14
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 14
rs 9.75
c 0
b 0
f 0
cc 2
nop 1
1
"""
2
Tests for the Marvin Google action
3
"""
4
5
from unittest import mock
6
7
from test_action import ActionTest
8
from irc2phpbb import marvin_actions
9
10
class GoogleTest(ActionTest):
11
    """Tests for the Marvin Google action"""
12
    def testGoogle(self):
13
        """Test that marvin can help google stuff"""
14
        with mock.patch("irc2phpbb.marvin_actions.random") as r:
15
            r.randint.return_value = 1
16
            self.assertActionOutput(
17
                marvin_actions.marvinGoogle,
18
                "kan du googla mos",
19
                "LMGTFY https://www.google.se/search?q=mos")
20
            self.assertActionOutput(
21
                marvin_actions.marvinGoogle,
22
                "kan du googla google mos",
23
                "LMGTFY https://www.google.se/search?q=google+mos")
24
        self.assertActionSilent(marvin_actions.marvinGoogle, "du kan googla")
25
        self.assertActionSilent(marvin_actions.marvinGoogle, "gogool")
26