Exemplo n.º 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())
Exemplo n.º 2
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())
Exemplo n.º 3
0
def test_bytes2human():
    assert bytes2human(1) == '1.0 B'
    assert bytes2human(10000) == '9.8 KB'
    assert bytes2human(100001221) == '95.4 MB'
Exemplo n.º 4
0
def test_bytes2human():
    assert bytes2human(1) == '1.0 B'
    assert bytes2human(10000) == '9.8 KB'
    assert bytes2human(100001221) == '95.4 MB'
Exemplo n.º 5
0
def test_bytes2human():
    assert bytes2human(1) == "1.0 B"
    assert bytes2human(10000) == "9.8 KB"
    assert bytes2human(100001221) == "95.4 MB"