~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/launchpad/test_account.py

  • Committer: Aaron Bentley
  • Date: 2008-10-26 10:00:24 UTC
  • mfrom: (0.12.70 shelf-manager)
  • mto: This revision was merged to the branch mainline in revision 3823.
  • Revision ID: aaron@aaronbentley.com-20081026100024-08whjq5p54yah68r
Merge shelf-manager into shelf-ui

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
                             'SSH keys with Launchpad.', str(error))
65
65
 
66
66
    def test_set_lp_login_updates_authentication_conf(self):
67
 
        self.assertEqual([None, None], account._get_auth_user().values())
 
67
        self.assertIs(None, account._get_auth_user())
68
68
        account.set_lp_login('foo')
69
 
        self.assertEqual({'production': 'foo', 'staging': 'foo'},
70
 
                         account._get_auth_user())
 
69
        self.assertEqual('foo', account._get_auth_user())
71
70
 
72
71
    def test_get_lp_login_does_not_update_for_none_user(self):
73
72
        account.get_lp_login()
74
 
        self.assertEqual([None, None], account._get_auth_user().values())
 
73
        self.assertIs(None, account._get_auth_user())
75
74
 
76
75
    def test_get_lp_login_updates_authentication_conf(self):
77
76
        account._set_global_option('foo')
78
 
        self.assertEqual([None, None], account._get_auth_user().values())
 
77
        self.assertIs(None, account._get_auth_user())
79
78
        account.get_lp_login()
80
 
        self.assertEqual({'production': 'foo', 'staging': 'foo'},
81
 
                         account._get_auth_user())
 
79
        auth = config.AuthenticationConfig()
 
80
        self.assertEqual('foo', account._get_auth_user(auth))
 
81
        self.assertEqual('foo', auth.get_user('ssh', 'bazaar.launchpad.net'))
 
82
        self.assertEqual('foo', auth.get_user('ssh',
 
83
                                              'bazaar.staging.launchpad.net'))
82
84
 
83
85
    def test_get_lp_login_leaves_existing_credentials(self):
84
86
        auth = config.AuthenticationConfig()