facebook / facebook-python-business-sdk

Python SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
1.29k stars 635 forks source link

Fix integration test #497

Closed aparakian closed 6 years ago

aparakian commented 6 years ago

Hey there when running my integration test on my fork, I realized there was still a deprecated test considering the answer I received from the server:

ERROR: test_can_upload_zip (__main__.AdImageTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ubuntu/facebook-python-ads-sdk/facebook_business/test/integration.py", line 650, in test_can_upload_zip
    parent_id=self.TEST_ACCOUNT.get_id_assured(),
  File "facebook_business/adobjects/helpers/adimagemixin.py", line 34, in remote_create_from_zip
    files={filename: open_file},
  File "facebook_business/api.py", line 366, in call
    raise fb_response.error()
FacebookRequestError: 

  Message: Call was not successful
  Method:  POST
  Path:    https://graph.facebook.com/v3.0/act_103764136432935/adimages
  Params:  {}

  Status:  400
  Response:
    {
      "error": {
        "error_user_msg": "Uploading zip files to the POST/adimages endpoint is deprecated. Please use an image with extension of 'jpg', 'jpeg', 'gif', 'bmp', 'png', 'tiff', or 'tif'.", 
        "error_user_title": "Zip Files Deprecated from POST <AD_ACCOUNT_ID>/adimages endpoint", 
        "message": "Invalid parameter", 
        "type": "OAuthException", 
        "code": 100, 
        "error_subcode": 1815814, 
        "is_transient": false, 
        "fbtrace_id": "Cz4h7gkYsp6"
      }
    }

So I took the liberty to remove it.

aparakian commented 6 years ago

By the way your tox.ini does not include the test for the integration test file. Do you want me to add it in this PR or is that on purpose?

facebook-github-bot commented 6 years ago

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

facebook-github-bot commented 6 years ago

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

jingping2015 commented 6 years ago

This test will be deprecated in our feature release.

aparakian commented 6 years ago

Don't forget to run your tests as well! cc @jingping2015 the other tests are relevant