Skip to content

Commit

Permalink
Adjust values of zsync_block_size_for_1G to power of 2
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-suse committed Jul 27, 2020
1 parent 2d21d7e commit 692ad2d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions mb/tests/conf_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import unittest

from mb.conf import adjust_zsync_block_size_for_1G


class TestConfig(unittest.TestCase):

def test_adjust_zsync_block_size_for_1G(self):
cases = {
0: None,
1023: None,
1025: 1024,
3*1024: 2*1024,
4*1024: 4*1024,
4*1024+1: 4*1024,
1024*1024*1024+1: 1024*1024*1024
}
for n in cases:
self.assertEqual(cases[n], adjust_zsync_block_size_for_1G(n), "for input " + repr(n))

if __name__ == '__main__':
unittest.main()

0 comments on commit 692ad2d

Please sign in to comment.