Have all unit tests import from our own subclass of trial's unittest TestCase; set up logging in ONE PLACE ONLY

This commit is contained in:
Paul "LeoNerd" Evans 2014-09-12 18:24:53 +01:00
parent 958b52596c
commit cd62ee3f29
21 changed files with 52 additions and 61 deletions

View file

@ -14,11 +14,10 @@
# limitations under the License.
from twisted.trial import unittest
from tests import unittest
from twisted.internet import defer, reactor
from mock import Mock, call, ANY
import logging
import json
from ..utils import MockHttpResource, MockClock, DeferredMockCallable
@ -34,9 +33,6 @@ UNAVAILABLE = PresenceState.UNAVAILABLE
ONLINE = PresenceState.ONLINE
logging.getLogger().addHandler(logging.NullHandler())
def _expect_edu(destination, edu_type, content, origin="test"):
return {
"origin": origin,
@ -92,7 +88,6 @@ class PresenceStateTestCase(unittest.TestCase):
# Mock the RoomMemberHandler
room_member_handler = Mock(spec=[])
hs.handlers.room_member_handler = room_member_handler
logging.getLogger().debug("Mocking room_member_handler=%r", room_member_handler)
# Some local users to test with
self.u_apple = hs.parse_userid("@apple:test")