Example #1
0
 def test_get_ubuntu_backend(self):
     # test that we get the real one
     self.assertEqual(type(get_ubuntu_sso_backend()), UbuntuSSO)
     # test that we get the fake one
     os.environ["SOFTWARE_CENTER_FAKE_REVIEW_API"] = "1"
     self.assertEqual(type(get_ubuntu_sso_backend()), UbuntuSSOAPIFake)
     # clean the environment
     del os.environ["SOFTWARE_CENTER_FAKE_REVIEW_API"]
 def test_get_ubuntu_backend(self):
     # test that we get the real one
     self.assertEqual(type(get_ubuntu_sso_backend()), UbuntuSSOAPI)
     # test that we get the fake one
     os.environ["SOFTWARE_CENTER_FAKE_REVIEW_API"] = "1"
     self.assertEqual(type(get_ubuntu_sso_backend()), UbuntuSSOAPIFake)
     # clean the environment
     del os.environ["SOFTWARE_CENTER_FAKE_REVIEW_API"]
Example #3
0
 def _maybe_login_successful(self, sso, oauth_result):
     self.ssoapi = get_ubuntu_sso_backend()
     self.ssoapi.connect("whoami", self._whoami_done)
     self.ssoapi.connect("error", self._whoami_error)
     # this will automatically verify the keyring token and retrigger
     # login (once) if its expired
     self.ssoapi.whoami()
 def _maybe_login_successful(self, sso, oauth_result):
     self.ssoapi = get_ubuntu_sso_backend()
     self.ssoapi.connect("whoami", self._whoami_done)
     self.ssoapi.connect("error", self._whoami_error)
     # this will automatically verify the keyring token and retrigger
     # login (once) if its expired
     self.ssoapi.whoami()
Example #5
0
 def _maybe_login_successful(self, sso, oauth_result):
     """ called after we have the token, then we go and figure out our name """
     logging.debug("_maybe_login_successful")
     self.ssoapi = get_ubuntu_sso_backend()
     self.ssoapi.connect("whoami", self._whoami_done)
     self.ssoapi.connect("error", self._whoami_error)
     # this will automatically verify the keyring token and retrigger 
     # login (once) if its expired
     self.ssoapi.whoami()
 def _maybe_login_successful(self, sso, oauth_result):
     """called after we have the token, then we go and figure out our
        name
     """
     logging.debug("_maybe_login_successful")
     self.ssoapi = get_ubuntu_sso_backend()
     self.ssoapi.connect("whoami", self._whoami_done)
     self.ssoapi.connect("error", self._whoami_error)
     # this will automatically verify the keyring token and retrigger
     # login (once) if its expired
     self.ssoapi.whoami()