Logo Search packages:      
Sourcecode: ubuntuone-couch version File versions  Download package

def ubuntuone::tests::test_auth::QueryTestCase::test_get_oauth_credentials (   self )
Test get_oauth_credentials returns proper oauth data.

Definition at line 80 of file test_auth.py.

                                        :
        """Test get_oauth_credentials returns proper oauth data."""
        self.patch(auth, "_undbusify", lambda x: x)
        dbus = self.mocker.replace("dbus")
        self.mocker.replace("dbus.mainloop.glib.DBusGMainLoop")
        bus = dbus.SessionBus()
        bus.get_object(
            ubuntu_sso.DBUS_BUS_NAME, ubuntu_sso.DBUS_CRED_PATH,
            follow_name_owner_changes=True)
        mock_proxy = self.mocker.mock()
        self.mocker.result(mock_proxy)
        mock_proxy.find_credentials(APP_NAME)
        self.mocker.result({
            u'token': TOKEN_KEY,
            u'token_secret': TOKEN_SECRET,
            u'consumer_secret': CONSUMER_SECRET,
            u'consumer_key': CONSUMER_KEY})
        self.mocker.replay()
        oauth_data = get_oauth_credentials()
        self.assertEquals(TOKEN_KEY, oauth_data['token'])
        self.assertEquals(TOKEN_SECRET, oauth_data['token_secret'])
        self.assertEquals(CONSUMER_KEY, oauth_data['consumer_key'])
        self.assertEquals(CONSUMER_SECRET, oauth_data['consumer_secret'])


Generated by  Doxygen 1.6.0   Back to index