pmb.helpers.other.folder_size: use kilobytes (MR 2074)

busybox du doesn't support bytes or custom block sizes.
This commit is contained in:
Maxim Karasev 2021-06-24 02:50:47 +03:00 committed by Alexey Min
parent 5c1da79634
commit 31e7a0006d
No known key found for this signature in database
GPG key ID: EBF5ECFFFEE34DED
4 changed files with 6 additions and 7 deletions

View file

@ -31,7 +31,7 @@ def test_get_folder_size(args, tmpdir):
# Check if the size is correct. Unfortunately, the `du` call
# in pmb.helpers.other.folder_size is not very accurate, so we
# allow 30kb of tolerance (good enough for our use case): #760 #1717
tolerance = 30 * 1024
size = 204800 * files
tolerance = 30
size = 200 * files
result = pmb.helpers.other.folder_size(args, tmpdir)
assert (result < size + tolerance and result > size - tolerance)