def test_ctrl_c(self, patched_pyb_discord, patched_exit): patched_pyb_discord.return_value.our_start.side_effect = KeyboardInterrupt() # with self.assertRaises(KeyboardInterrupt): pyborg_discord.start_discord_bot() patched_exit.assert_called_once_with() patched_pyb_discord.return_value.teardown.assert_called_once_with()
def test_handle_exception(self, patched_pyb_discord): patched_pyb_discord.return_value.our_start.side_effect = Exception with self.assertRaises(Exception): pyborg_discord.start_discord_bot() patched_pyb_discord.return_value.teardown.assert_called_once_with()
def test_launch(self, patched_pyb_discord): pyborg_discord.start_discord_bot() patched_pyb_discord.assert_called_with('example.discord.toml') patched_pyb_discord.return_value.our_start.assert_called_with()