示例#1
0
 def test_eat_healthy(self):
     """assert if a == b, eat healthy should have positive message"""
     self.assertEqual(
         # execute functionality with target input
         eat("broccoli", is_healthy=True),
         # define expected output
         "I'm eating broccoli, because my body is a temple.")
示例#2
0
文件: test.py 项目: Exia01/Python
 def test_no_eat(self):
     """ Eat should have a positive message for healthy eating """
     self.assertEqual(eat("", is_healthy=None), "I'm not really hungry")
示例#3
0
 def test_eat_unhealthily(self):
     """Indicate you've given up for eating unhealthily."""
     self.assertEqual(eat("pizza", is_healthy=False),
                      "I'm eating pizza, because YOLO!")
示例#4
0
 def test_eat_unhealthy(self):
     """Testing for unhealthy food eat function"""
     self.assertEqual(eat("pizza", is_healthy=False),
                      "I'm eating pizza, because YOLO")
示例#5
0
 def test_eat(self):
     self.assertEqual(eat("broccoli", is_healthy=True),
                      "I'm eating broccoli, because my body is a temple")
     self.assertEqual(eat("pizza", is_healthy=False),
                      "I'm eating pizza, because YOLO")
示例#6
0
 def test_eat_healthy(self):
     self.assertEqual(eat("broccoli", is_healthy=True),
                      "I'm eating broccoli because my body is a temple")
示例#7
0
	def test_eat_unhealthy(self):
		self.assertEqual(
			eat("pizza", ishealthy=False),
			"I'm eating broccoli, because YOLO."
			)
示例#8
0
 def test_eat_unhealthy(self):
     """Testing for eating un healthy, should have an unhealthy message"""
     self.assertEqual(eat("pizza", is_healthy=False),
                      "I'm eating pizza, because YOLO!")
示例#9
0
 def test_eat_healthy(self):
     """eat should have a positive message for healthy eating"""
     self.assertEqual(eat('broccoli', is_healthy=True),
                      'Im eating broccoli, because my body is a temple')
示例#10
0
 def test_eat_healthy_boolean(self):
     """is healthy must be a bool"""
     with self.assertRaises(ValueError):
         eat('pizza', is_healthy='who cars')
示例#11
0
 def test_eat_unhealthy(self):
     """eat should indicate you've given up on healthy eating"""
     self.assertEqual(eat('pizza', is_healthy=False),
                      'Im eating pizza, because YOLO')
示例#12
0
 def test_eat_unhealthy_bool(self):
     """is healthy must be a boolean"""
     with self.assertRaises(ValueError):
         eat("pizza", is_healthy="who gives?")
示例#13
0
 def test_eat_unhealthy(self):
     """You gave up healthy eating"""
     self.assertEqual(eat("pizza", is_healthy=False),
                      "I am eating pizza because YOLO!")
示例#14
0
文件: test.py 项目: Exia01/Python
 def test_eat_boolean(self):
     """ No value error passed """
     with self.assertRaises(ValueError):
         eat("pizza", is_healthy="who cares?")
示例#15
0
 def test_eat_healthy_boolean(self):
     with self.assertRaises(ValueError):
         eat("pizza", is_healthy="who cares")
示例#16
0
 def test_eat_healthy(self):
     """eat should have positive message for healthy eating"""
     self.assertEqual(
         eat("broccoli", is_healthy=True),
         "I'm eating broccoli, because its Healthy food")
示例#17
0
 def test_eat_healthy(self):
     """eat should return positive message for healthy eating"""
     self.assertEqual(eat("broccoli", is_healthy=True),
                      "I'm eating broccoli, because my body is a temple")
示例#18
0
 def test_eat_unhealthy(self):
     """Eat should have a f**k it message for unhealthy eating"""
     self.assertEqual(eat("pizza", is_healthy=False),
                      "I'm eating pizza because YOLO!")
示例#19
0
 def test_eat_healthy(self):
     """Testing for eating healthy, should have healthy message"""
     self.assertEqual(eat("broccoli", is_healthy=True),
                      "I'm eating broccoli, its healthy")
示例#20
0
 def test_eat_unhealthy(self):
     ''' eat should indicate you've given up eating healthy'''
     self.assertEqual(eat("pizza", is_healthy=False),
                      "I'm eating pizza, because YOLO")
示例#21
0
	def test_eat_healthy_boolean(self):
		with self.assertRaises(ValueError):
			eat('pizza', ishealthy="who cares?")
示例#22
0
 def test_eat_healthy(self):
     """Testing eat healthy"""
     self.assertEqual(eat("broccoli", is_healthy=True),
                      "I'm eating broccoli because is healthy")
示例#23
0
 def test_eat_unhealthy(self):
     self.assertEqual(eat("pizza", is_healthy=False),
                      "I'm eathing pizza because YOLO")
示例#24
0
 def test_eat_unhealthy(self):
     """Testing eat unhealthy"""
     self.assertEqual(eat("pizza", is_healthy=False),
                      "I'm eating pizza because is delicious")
示例#25
0
 def test_eat_healthy_boolean(self):
     """is_healthy must be a bool"""
     with self.assertRaises(ValueError):
         eat("pizza", is_healthy="who cares?")
示例#26
0
 def test_eat_boolean(self):
     """Testing a boolean parameter"""
     with self.assertRaises(ValueError):
         eat("pizza", "?")
示例#27
0
 def test_eat_healthy(self):
     """Testing for healthy food eat function"""
     self.assertEqual(eat("brocolli", is_healthy=True),
                      "I'm eating brocolli, because my body is a temple.")
示例#28
0
 def test_eat_unhealthly(self):
     """Eat should indicate you've given up for eating healthy food."""
     self.assertEqual(eat("pizza", is_healthy=False),
                      "I'm eating pizza, because YOLO!")
示例#29
0
 def test_eat_healthily(self):
     """Eat should have a positive message for healthy eating."""
     self.assertEqual(eat("broccoli", is_healthy=True),
                      "I'm eating broccoli, because my body is a temple.")
示例#30
0
 def test_eat_junk(self):
     """Eat should have a negative message for crappy eating habits"""
     self.assertEqual(eat("pizza", is_healthy=False),
                      "I'm eating pizza, because YOLO.")