fixed LinkedIn to set friend['contact']
authorFredrik Wendt <fredrik@wendt.se>
Tue, 8 Jun 2010 21:01:30 +0000 (22:01 +0100)
committerFredrik Wendt <fredrik@wendt.se>
Tue, 8 Jun 2010 21:01:30 +0000 (22:01 +0100)
Signed-off-by: Fredrik Wendt <fredrik@wendt.se>

package/src/org/maemo/hermes/engine/facebook/service.py
package/test/unit/test_facebook.py

index ac8915d..4ca2223 100644 (file)
@@ -109,10 +109,12 @@ class Service(org.maemo.hermes.engine.service.Service):
 
     # -----------------------------------------------------------------------
     def _register_match(self, contact, friend):
+        friend.set_contact(contact)
         self._friends_without_contact.discard(friend)
         self._friends_by_contact[contact] = friend
         self._contacts_by_friend[friend] = contact
 
+
     # -----------------------------------------------------------------------
     def _get_friends_data(self):
         """Returns a list of dicts, where each dict represents a friend/contact"""
index 9603143..659b6a9 100644 (file)
@@ -46,7 +46,9 @@ class TestFacebookService(unittest.TestCase):
         assert len(friends) == 2
         assert len(contacts) == 2
         assert self.other_contact in contacts
+        assert self.other_contact == contacts[self.other_contact].get_contact()
         assert self.existing_contact in contacts
+        assert self.existing_contact == contacts[self.existing_contact].get_contact()
         assert self.none_contact not in contacts
         
         
@@ -63,7 +65,8 @@ class TestFacebookService(unittest.TestCase):
         matchers = self.testee.get_contacts_with_match().keys()
         assert len(matchers) == 1
         assert matchers[0].id == 1
-        
+
+      
     def test_name_collision_avoided_only_one_person_matched(self):
         contact_do_match = FakeContact("Same Name", ["http://twitter.com/same_name"]);
         contact_no_match = FakeContact("Same Name", [None])