def get_size(self): """Returns the size of the cache with units as a string. Returns ------- str """ return bytes2human(self.get_size_in_bytes())
def test_bytes2human(): assert bytes2human(1) == '1.0 B' assert bytes2human(10000) == '9.8 KB' assert bytes2human(100001221) == '95.4 MB'
def test_bytes2human(): assert bytes2human(1) == "1.0 B" assert bytes2human(10000) == "9.8 KB" assert bytes2human(100001221) == "95.4 MB"