Code review comment for lp:~michaelh1/linaro-image-tools/fractional-partitions

Revision history for this message
Данило Шеган (danilo) wrote :

Michael, thanks for working on this. This generally looks good, but please add a test for float values being passed in. Just add another test along the lines of test_convert_size_in_kbytes_to_bytes to
linaro_image_tools/media_create/tests/test_media_create.py that tests the new behavior.

Considering we are adding support for floats, one will also be able to say something like 1.0005K. What would you expect the proper behavior to be in that case? I'd expect 1001 bytes to be returned, so I'd also modify the return to round upwards, i.e.
  return int(real_size + 0.5)

(and add a test for this particular behavior as well).

It would also be good to file a bug for this feature request, so we can easily track what's going into the next release, so please do that as well.

review: Needs Fixing

« Back to merge proposal