##// END OF EJS Templates
vcs: make hg get_changesets compatible with py3...
vcs: make hg get_changesets compatible with py3 If start was 0, we would end up with start_pos None and getting a compare with None which would fail in py3. Instead, make sure start_pos is None iff start is None. Also, make the actual check more robust.

File last commit:

r7048:8f30206a default
r7941:7c43e15f default
Show More
test_utils_filesize.py
19 lines | 546 B | text/x-python | PythonLexer
/ kallithea / tests / vcs / test_utils_filesize.py
from kallithea.lib.vcs.utils.filesize import filesizeformat
class TestFilesizeformat(object):
def test_bytes(self):
assert filesizeformat(10) == '10 B'
def test_kilobytes(self):
assert filesizeformat(1024 * 2) == '2 KB'
def test_megabytes(self):
assert filesizeformat(1024 * 1024 * 2.3) == '2.3 MB'
def test_gigabytes(self):
assert filesizeformat(1024 * 1024 * 1024 * 12.92) == '12.92 GB'
def test_that_function_respects_sep_parameter(self):
assert filesizeformat(1, '') == '1B'