~robru/friends/linkedin-protocol

« back to all changes in this revision

Viewing changes to friends/protocols/linkedin.py

  • Committer: Robert Bruce Park
  • Date: 2013-07-17 02:17:06 UTC
  • Revision ID: robert.park@canonical.com-20130717021706-u0j7mffyr2gr3bll
Add initial unit tests + scrubbed test data for linkedin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
            token=self._get_access_token())
45
45
        result = Downloader(url).get_json()
46
46
        self._account.user_id = result.get('id')
47
 
        self._account.user_full_name = '{firstName} {lastName}'.format(**result)
 
47
        self._account.user_name = '{firstName} {lastName}'.format(**result)
48
48
 
49
49
    def _publish_entry(self, entry, stream='messages'):
50
50
        """Publish a single update into the Dee.SharedModel."""
92
92
        values = result.get('values')
93
93
        for update in values:
94
94
            self._publish_entry(update)
 
95
        return self._get_n_rows()
95
96
 
96
97
    @feature
97
98
    def receive(self):
98
99
        """Gather and publish all incoming messages."""
99
 
        self.home()
100
 
        return self._get_n_rows()
 
100
        return self.home()
101
101
 
102
102
    def _create_contact(self, connection_json):
103
103
        """Build a VCard based on a dict representation of a contact."""