| Total Complexity | 2 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 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 |