def test_eggs_allergic_to_everything(self): self.assertIs(Allergies(255).allergic_to("eggs"), True)
def test_allergic_to_something_but_not_chocolate(self): self.assertIs(Allergies(80).allergic_to("chocolate"), False)
def test_pollen_not_allergic_to_anything(self): self.assertIs(Allergies(0).allergic_to("pollen"), False)
def test_tomatoes_allergic_to_everything(self): self.assertIs(Allergies(255).allergic_to("tomatoes"), True)
def test_allergic_only_to_chocolate(self): self.assertIs(Allergies(32).allergic_to("chocolate"), True)
def test_allergic_only_to_tomatoes(self): self.assertIs(Allergies(16).allergic_to("tomatoes"), True)
def test_allergic_to_something_but_not_tomatoes(self): self.assertIs(Allergies(40).allergic_to("tomatoes"), False)
def test_shellfish_not_allergic_to_anything(self): self.assertIs(Allergies(0).allergic_to("shellfish"), False)
def test_allergic_only_to_shellfish(self): self.assertIs(Allergies(4).allergic_to("shellfish"), True)
def test_allergic_to_something_but_not_peanuts(self): self.assertIs(Allergies(5).allergic_to("peanuts"), False)
def test_peanuts_allergic_to_everything(self): self.assertIs(Allergies(255).allergic_to("peanuts"), True)
def test_allergic_to_peanuts_and_something_else(self): self.assertIs(Allergies(7).allergic_to("peanuts"), True)
def test_allergic_only_to_peanuts(self): self.assertIs(Allergies(2).allergic_to("peanuts"), True)
def test_peanuts_not_allergic_to_anything(self): self.assertIs(Allergies(0).allergic_to("peanuts"), False)
def test_strawberries_allergic_to_everything(self): self.assertIs(Allergies(255).allergic_to("strawberries"), True)
def test_allergic_to_shellfish_and_something_else(self): self.assertIs(Allergies(14).allergic_to("shellfish"), True)
def test_tomatoes_not_allergic_to_anything(self): self.assertIs(Allergies(0).allergic_to("tomatoes"), False)
def test_allergic_to_something_but_not_shellfish(self): self.assertIs(Allergies(10).allergic_to("shellfish"), False)
def test_allergic_to_tomatoes_and_something_else(self): self.assertIs(Allergies(56).allergic_to("tomatoes"), True)
def test_shellfish_allergic_to_everything(self): self.assertIs(Allergies(255).allergic_to("shellfish"), True)
def test_eggs_not_allergic_to_anything(self): self.assertIs(Allergies(0).allergic_to("eggs"), False)
def test_strawberries_not_allergic_to_anything(self): self.assertIs(Allergies(0).allergic_to("strawberries"), False)
def test_chocolate_not_allergic_to_anything(self): self.assertIs(Allergies(0).allergic_to("chocolate"), False)
def test_allergic_only_to_strawberries(self): self.assertIs(Allergies(8).allergic_to("strawberries"), True)
def test_allergic_to_chocolate_and_something_else(self): self.assertIs(Allergies(112).allergic_to("chocolate"), True)
def test_allergic_to_strawberries_and_something_else(self): self.assertIs(Allergies(28).allergic_to("strawberries"), True)
def test_chocolate_allergic_to_everything(self): self.assertIs(Allergies(255).allergic_to("chocolate"), True)
def test_allergic_to_something_but_not_strawberries(self): self.assertIs(Allergies(20).allergic_to("strawberries"), False)
def test_no_allergies_means_not_allergic(self): allergies = Allergies(0) self.assertFalse(allergies.is_allergic_to('peanuts')) self.assertFalse(allergies.is_allergic_to('cats')) self.assertFalse(allergies.is_allergic_to('strawberries'))
def test_allergic_to_something_but_not_eggs(self): self.assertIs(Allergies(2).allergic_to("eggs"), False)