示例#1
0
    def test_get(self):
        client = BoxClient('my_token')
        expected_response = self.make_response()
        flexmock(requests) \
            .should_receive('get') \
            .with_args('https://api.box.com/2.0/foo', params={'arg': 'value'}, headers=client._headers, crap=1) \
            .and_return(expected_response) \
            .once()

        actual_response = client._get('foo', {'arg': 'value'}, crap=1)
        self.assertEqual(expected_response, actual_response)