| Conditions | 4 |
| Total Lines | 13 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """ |
||
| 12 | def testLunchLocations(self): |
||
| 13 | """Test that marvin can provide lunch suggestions for certain places""" |
||
| 14 | locations = ["karlskrona", "goteborg", "angelholm", "hassleholm", "malmo"] |
||
| 15 | with mock.patch("irc2phpbb.marvin_actions.random") as r: |
||
| 16 | for location in locations: |
||
| 17 | for i, place in enumerate(self.strings.get("lunch").get("location").get(location)): |
||
| 18 | r.randint.side_effect = [0, i] |
||
| 19 | self.assertActionOutput( |
||
| 20 | marvin_actions.marvinLunch, f"mat {location}", f"Ska vi ta {place}?") |
||
| 21 | r.randint.side_effect = [1, 2] |
||
| 22 | self.assertActionOutput( |
||
| 23 | marvin_actions.marvinLunch, "dags att luncha", "Jag är lite sugen på Indiska?") |
||
| 24 | self.assertActionSilent(marvin_actions.marvinLunch, "matdags") |
||
| 25 |