def test_in_second_byte(self):
     seg = RegisterSegment("NAME", 9, 11, [0] * 3)
     seg.update_bits([213, 170])
     self.assertEqual(seg.bits, [1, 0, 1])
 def test_not_enough_bits(self):
     seg = RegisterSegment("NAME", 9, 11, [0] * 3)
     with self.assertRaises(KeyError):
         seg.update_bits([240])
 def test_perfect(self):
     seg = RegisterSegment("NAME", 0, 2, [0] * 3)
     seg.update_bits([213, 170])
     self.assertEqual(seg.bits, [1, 0, 1])