class TestImmunityBitstring(TC):
    def setUp(self):
        self.value = Bitstring("10101")
        self.binding_range = 2
        self.i = Immunity(self.value, self.binding_range)

    def test_init(self):
        self.assertEqual(self.value, self.i.id)
        self.assertEqual(self.binding_range, self.i.binding_range)

    def test_can_bind(self):
        c = Colicin(self.value)
        self.assertTrue(self.i.can_bind(c))
        c_not = Colicin(Bitstring("01010"))
        self.assertFalse(self.i.can_bind(c_not))

    def test_mutate(self):
        i2 = self.i.mutate()
        self.assertNotEqual(self.i, i2)
 def setUp(self):
     self.value = Bitstring("10101")
     self.binding_range = 2
     self.i = Immunity(self.value, self.binding_range)