예제 #1
0
    def get_size(self):
        """Returns the size of the cache with units as a string.

        Returns
        -------
        str
        """
        return bytes2human(self.get_size_in_bytes())
예제 #2
0
파일: cache.py 프로젝트: jacky168/nengo
    def get_size(self):
        """Returns the size of the cache with units as a string.

        Returns
        -------
        str
        """
        return bytes2human(self.get_size_in_bytes())
예제 #3
0
def test_bytes2human():
    assert bytes2human(1) == '1.0 B'
    assert bytes2human(10000) == '9.8 KB'
    assert bytes2human(100001221) == '95.4 MB'
예제 #4
0
파일: test_cache.py 프로젝트: epaxon/nengo
def test_bytes2human():
    assert bytes2human(1) == '1.0 B'
    assert bytes2human(10000) == '9.8 KB'
    assert bytes2human(100001221) == '95.4 MB'
예제 #5
0
def test_bytes2human():
    assert bytes2human(1) == "1.0 B"
    assert bytes2human(10000) == "9.8 KB"
    assert bytes2human(100001221) == "95.4 MB"