| Total Complexity | 1 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 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 |