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