Example #1
0
 def test_eggs_allergic_to_everything(self):
     self.assertIs(Allergies(255).allergic_to("eggs"), True)
Example #2
0
 def test_allergic_to_something_but_not_chocolate(self):
     self.assertIs(Allergies(80).allergic_to("chocolate"), False)
Example #3
0
 def test_pollen_not_allergic_to_anything(self):
     self.assertIs(Allergies(0).allergic_to("pollen"), False)
Example #4
0
 def test_tomatoes_allergic_to_everything(self):
     self.assertIs(Allergies(255).allergic_to("tomatoes"), True)
Example #5
0
 def test_allergic_only_to_chocolate(self):
     self.assertIs(Allergies(32).allergic_to("chocolate"), True)
Example #6
0
 def test_allergic_only_to_tomatoes(self):
     self.assertIs(Allergies(16).allergic_to("tomatoes"), True)
Example #7
0
 def test_allergic_to_something_but_not_tomatoes(self):
     self.assertIs(Allergies(40).allergic_to("tomatoes"), False)
Example #8
0
 def test_shellfish_not_allergic_to_anything(self):
     self.assertIs(Allergies(0).allergic_to("shellfish"), False)
Example #9
0
 def test_allergic_only_to_shellfish(self):
     self.assertIs(Allergies(4).allergic_to("shellfish"), True)
Example #10
0
 def test_allergic_to_something_but_not_peanuts(self):
     self.assertIs(Allergies(5).allergic_to("peanuts"), False)
Example #11
0
 def test_peanuts_allergic_to_everything(self):
     self.assertIs(Allergies(255).allergic_to("peanuts"), True)
Example #12
0
 def test_allergic_to_peanuts_and_something_else(self):
     self.assertIs(Allergies(7).allergic_to("peanuts"), True)
Example #13
0
 def test_allergic_only_to_peanuts(self):
     self.assertIs(Allergies(2).allergic_to("peanuts"), True)
Example #14
0
 def test_peanuts_not_allergic_to_anything(self):
     self.assertIs(Allergies(0).allergic_to("peanuts"), False)
Example #15
0
 def test_strawberries_allergic_to_everything(self):
     self.assertIs(Allergies(255).allergic_to("strawberries"), True)
Example #16
0
 def test_allergic_to_shellfish_and_something_else(self):
     self.assertIs(Allergies(14).allergic_to("shellfish"), True)
Example #17
0
 def test_tomatoes_not_allergic_to_anything(self):
     self.assertIs(Allergies(0).allergic_to("tomatoes"), False)
Example #18
0
 def test_allergic_to_something_but_not_shellfish(self):
     self.assertIs(Allergies(10).allergic_to("shellfish"), False)
Example #19
0
 def test_allergic_to_tomatoes_and_something_else(self):
     self.assertIs(Allergies(56).allergic_to("tomatoes"), True)
Example #20
0
 def test_shellfish_allergic_to_everything(self):
     self.assertIs(Allergies(255).allergic_to("shellfish"), True)
Example #21
0
 def test_eggs_not_allergic_to_anything(self):
     self.assertIs(Allergies(0).allergic_to("eggs"), False)
Example #22
0
 def test_strawberries_not_allergic_to_anything(self):
     self.assertIs(Allergies(0).allergic_to("strawberries"), False)
Example #23
0
 def test_chocolate_not_allergic_to_anything(self):
     self.assertIs(Allergies(0).allergic_to("chocolate"), False)
Example #24
0
 def test_allergic_only_to_strawberries(self):
     self.assertIs(Allergies(8).allergic_to("strawberries"), True)
Example #25
0
 def test_allergic_to_chocolate_and_something_else(self):
     self.assertIs(Allergies(112).allergic_to("chocolate"), True)
Example #26
0
 def test_allergic_to_strawberries_and_something_else(self):
     self.assertIs(Allergies(28).allergic_to("strawberries"), True)
Example #27
0
 def test_chocolate_allergic_to_everything(self):
     self.assertIs(Allergies(255).allergic_to("chocolate"), True)
Example #28
0
 def test_allergic_to_something_but_not_strawberries(self):
     self.assertIs(Allergies(20).allergic_to("strawberries"), False)
Example #29
0
 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'))
Example #30
0
 def test_allergic_to_something_but_not_eggs(self):
     self.assertIs(Allergies(2).allergic_to("eggs"), False)