~robru/gwibber/twitter-from-me-fix

« back to all changes in this revision

Viewing changes to gwibber/gwibber/testing/helpers.py

  • Committer: Barry Warsaw
  • Date: 2012-09-21 18:46:21 UTC
  • mfrom: (1437.1.2 robru)
  • Revision ID: barry@python.org-20120921184621-o6xncvo0mvrt9nxj
Merge, with minor changes, lp:~robru/gwibber/accounts-fixup, which principly
cleans up the interface with libaccounts, and changes blanket attribute access
via dictionary lookup to specific direct. attribute accesses.

Also:
  * Make Account.enabled a property.
  * Add more explanation about why the gi.repository.Account API sucks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import threading
23
23
 
24
24
 
25
 
class FakeAccount(dict):
 
25
class FakeAuth:
 
26
    pass
 
27
 
 
28
 
 
29
class FakeAccount:
26
30
    """A fake account object for testing purposes."""
27
31
 
28
32
    def __init__(self, service=None):
 
33
        self.access_token = None
 
34
        self.user_name = None
 
35
        self.user_id = None
 
36
        self.auth = FakeAuth()
29
37
        self.login_lock = threading.Lock()
30
 
        self.global_id = 'fake global id'
31
 
        self['id'] = 'faker/than fake'
 
38
        self.id = 'faker/than fake'