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