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

test_google   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 18
dl 0
loc 26
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A GoogleTest.testGoogle() 0 14 2
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