示例#1
0
 def test_lower_bound(self):
     low_val = b'-11'
     with self.assertRaises(UnacknowledgedOption):
         timeout_parser(low_val)
示例#2
0
 def test_float_within_acceptable_range(self):
     val = b'20.5'
     self.assertEqual(timeout_parser(val), 20.5)
示例#3
0
 def test_garbage_data(self):
     val = b'\x41'
     with self.assertRaises(ValueError):
         timeout_parser(val)
示例#4
0
 def test_upper_bound(self):
     high_val = b'999'
     with self.assertRaises(UnacknowledgedOption):
         timeout_parser(high_val)
示例#5
0
 def test_lower_bound(self):
     low_val = b'-11'
     with self.assertRaises(UnacknowledgedOption):
         timeout_parser(low_val)
示例#6
0
 def test_garbage_data(self):
     val = b'\x41'
     with self.assertRaises(ValueError):
         timeout_parser(val)
示例#7
0
 def test_float_within_acceptable_range(self):
     val = b'20.5'
     self.assertEqual(timeout_parser(val), 20.5)
示例#8
0
 def test_upper_bound(self):
     high_val = b'999'
     with self.assertRaises(UnacknowledgedOption):
         timeout_parser(high_val)