def test_human2bytes(): assert tools.human2bytes('1TB') == 10**12 assert tools.human2bytes('1GB') == 10**9 assert tools.human2bytes('1.5GB') == 10**9*1.5 assert tools.human2bytes('1MB') == 10**6 assert tools.human2bytes('1KB') == 10**3 assert tools.human2bytes('128') == 128 assert tools.human2bytes('0') == 0 assert tools.human2bytes('1TiB') == 1024**4 assert tools.human2bytes('1GiB') == 1024**3 assert tools.human2bytes('1MiB') == 1024**2 assert tools.human2bytes('1kiB') == 1024
def test_human2bytes_exc2(): tools.human2bytes('asdf')
def validate(self, text): human2bytes(text)
def test_human2bytes_exc1(): tools.human2bytes('')
def from_xml(self, text): return human2bytes(text)