def test_change_comment(self): client = BoxClient("my_token") response = {"type": "comment", "id": 123, "message": "new_message" } (flexmock(requests) .should_receive('request') .with_args("put", "https://api.box.com/2.0/comments/123", params=None, data=json.dumps({"message": "new_message"}), headers=client.default_headers) .and_return(mocked_response(response))) modified = client.change_comment(123, "new_message") self.assertEquals(modified, response)