forked from poeml/mirrorbrain
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust values of zsync_block_size_for_1G to power of 2
- Loading branch information
1 parent
7c13aa1
commit e0bf0b0
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |