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

def ubuntuone::tests::test_couch::QueryTestCase::test_get_user_info (   self )
Test get_user_info parses json correctly.

Definition at line 47 of file test_couch.py.

                                :
        """Test get_user_info parses json correctly."""
        mock_request = self.mocker.replace("ubuntuone.couch.auth.request")
        mock_request(
            URL, consumer_key=None, consumer_secret=None, access_token=None,
            token_secret=None)
        self.mocker.result((
            {'status': '200'},
            '{"couchdb_root": "https://couchdb.one.ubuntu.com/u/abc/def/1337",'
            ' "id": 1337}'))
        self.mocker.replay()
        user_id, root = get_user_info(URL)
        self.assertEquals(1337, user_id)
        self.assertEquals(
            "https://couchdb.one.ubuntu.com/u/abc/def/1337", root)


Generated by  Doxygen 1.6.0   Back to index