def max_size(self, section: str) -> int: # Default: see init() method return parse_hr_bytes(self.parser.get(section, MAX_SIZE))
def test_parse_bytes_mb(self): self.assertEqual(2 * 1024 * 1024, parse_hr_bytes('2MB'))
def test_parse_bytes_k(self): self.assertEqual(30000, parse_hr_bytes('30k'))
def test_parse_bytes_bad(self): self.assertTrue(parse_hr_bytes('BAD') < 0)
def test_parse_bytes(self): self.assertEqual(123, parse_hr_bytes('123'))
def max_size(self, section: str) -> int: size = self.parser.get(section, MAX_SIZE) return parse_hr_bytes(size)