Пример #1
0
 def test_garbage_data(self):
     val = b'\x41'
     with self.assertRaises(ValueError):
         blksize_parser(val)
Пример #2
0
 def test_upper_bound_capped(self):
     high_val = b'70000'
     self.assertEqual(blksize_parser(high_val, upper_bound=4096), 4096)
Пример #3
0
 def test_int_within_acceptable_range(self):
     val = b'2048'
     self.assertEqual(blksize_parser(val), 2048)
Пример #4
0
 def test_lower_bound(self):
     low_val = b'4'
     with self.assertRaises(UnacknowledgedOption):
         blksize_parser(low_val)
Пример #5
0
 def test_garbage_data(self):
     val = b'\x41'
     with self.assertRaises(ValueError):
         blksize_parser(val)
Пример #6
0
 def test_int_within_acceptable_range(self):
     val = b'2048'
     self.assertEqual(blksize_parser(val), 2048)
Пример #7
0
 def test_upper_bound_capped(self):
     high_val = b'70000'
     self.assertEqual(blksize_parser(high_val, upper_bound=4096), 4096)
Пример #8
0
 def test_lower_bound(self):
     low_val = b'4'
     with self.assertRaises(UnacknowledgedOption):
         blksize_parser(low_val)