def comp_human_size(i, o, p): if p is None: assert_equal(o, human_size(i)) else: assert_equal(o, human_size(i, precision=p))
def m(label, expected, actual): msg = "line {0}: Given size {1} ({2}), " msg = msg + "expected {3} of {4}; received {5}" return msg.format(lineno, size, human_size(size), label, expected, actual)