test: add helpers methods muteLogging and unmuteLogging

This commit is contained in:
souliane 2016-03-11 16:41:44 +01:00
commit 8bc634d4c2

View file

@ -21,7 +21,6 @@
""" Tests for the plugin room game (base class for MUC games) """
from sat.core.i18n import _
from sat.core.log import getLogger
from constants import Const
from sat.test import helpers, helpers_plugins
from sat.plugins import plugin_misc_room_game as plugin
@ -430,7 +429,9 @@ class RoomGameTest(helpers.SatTestCase):
def test__checkCreateGameAndInit(self):
self.reinit()
self.assertEqual((False, False), self.plugin._checkCreateGameAndInit(ROOM_JID, PROFILE)) # print internal error
helpers.muteLogging()
self.assertEqual((False, False), self.plugin._checkCreateGameAndInit(ROOM_JID, PROFILE))
helpers.unmuteLogging()
nick = self.plugin_0045.joinRoom(0, 0)
self.assertEqual((True, False), self.plugin._checkCreateGameAndInit(ROOM_JID, PROFILE))
@ -438,7 +439,9 @@ class RoomGameTest(helpers.SatTestCase):
self.assertFalse(self.plugin._gameExists(ROOM_JID, True))
self.assertTrue(self.plugin.isReferee(ROOM_JID, nick))
self.assertEqual((False, False), self.plugin._checkCreateGameAndInit(ROOM_JID, OTHER_PROFILE)) # print internal error
helpers.muteLogging()
self.assertEqual((False, False), self.plugin._checkCreateGameAndInit(ROOM_JID, OTHER_PROFILE))
helpers.unmuteLogging()
self.plugin_0045.joinRoom(0, 1)
self.assertEqual((False, False), self.plugin._checkCreateGameAndInit(ROOM_JID, OTHER_PROFILE))