Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop a hardcoded value in an error message. #48

Merged
merged 1 commit into from
Jan 16, 2019

Commits on Mar 1, 2018

  1. Drop a hardcoded value in an error message.

    The validation of `ResumableUpload.chunk_size` checks divisibility by a
    constant, and then provides an error with a hardcoded value for that constant.
    This can be confusing (eg googleapis#47).
    
    The fix here is to just insert the appropriate value into the error message.
    Adding a bad value still gives the expected error message, eg
    
    ```
    Traceback (most recent call last):
      File "/usr/local/google/home/craigcitro/gh/google-resumable-media-python/tests/unit/test__upload.py", line 245, in test_constructor
        upload = _upload.ResumableUpload(RESUMABLE_URL, 12 * 1024)#chunk_size)
      File "/usr/local/google/home/craigcitro/gh/google-resumable-media-python/google/resumable_media/_upload.py", line 323, in __init__
        resumable_media.UPLOAD_CHUNK_SIZE / 1024))
    ValueError: 256 KB must divide chunk size
    ```
    craigcitro committed Mar 1, 2018
    Configuration menu
    Copy the full SHA
    8685189 View commit details
    Browse the repository at this point in the history