diff src/test/test_core_xmpp.py @ 649:e20c823f23e2

tests: helpers improvments: - FakeParent renamed FakeClient - added FakeRoster class, and an instance of it in FakeClient (FakeClient.roster) - b2s function to convert boolean value to strings used in bridge - some fake methods (FakeClient.send, FakeSat.delContact) to avoid exceptions
author Goffi <goffi@goffi.org>
date Sun, 29 Sep 2013 16:29:36 +0200
parents 29cea30f20f5
children 9810f22ba733
line wrap: on
line diff
--- a/src/test/test_core_xmpp.py	Thu Sep 26 17:33:04 2013 +0200
+++ b/src/test/test_core_xmpp.py	Sun Sep 29 16:29:36 2013 +0200
@@ -46,7 +46,7 @@
     def setUp(self):
         self.host = helpers.FakeSAT()
         self.message = xmpp.SatMessageProtocol(self.host)
-        self.message.parent = helpers.FakeParent()
+        self.message.parent = helpers.FakeClient(self.host)
 
     def test_onMessage(self):
         xml = """
@@ -64,7 +64,7 @@
     def setUp(self):
         self.host = helpers.FakeSAT()
         self.roster = xmpp.SatRosterProtocol(self.host)
-        self.roster.parent = helpers.FakeParent()
+        self.roster.parent = helpers.FakeClient(self.host)
 
     def test_onRosterSet(self):
         roster_item = RosterItem(helpers.TEST_JID)
@@ -82,7 +82,7 @@
     def setUp(self):
         self.host = helpers.FakeSAT()
         self.presence = xmpp.SatPresenceProtocol(self.host)
-        self.presence.parent = helpers.FakeParent()
+        self.presence.parent = helpers.FakeClient(self.host)
 
     def test_availableReceived(self):
         self.host.bridge.expectCall("presenceUpdate", helpers.TEST_JID_STR, "xa", 15, {'default': "test status", 'fr': 'statut de test'}, helpers.TEST_PROFILE)