def test_power(self):
     self.assertIsNotNone(main.power)
     self.assertEqual(main.power(3, 4), 3**4)
     self.assertEqual(main.power(-2, 3), -2**3)
     self.assertEqual(main.power(62, 0), 1)
     for _ in range(10):
         x = random.randrange(-10, 10)
         y = random.randrange(0, 10)
         self.assertEqual(main.power(x, y), x**y)
Esempio n. 2
0
 def test_answer(self):
     assert power(1, 2) == 1
     assert power(3, 2) == 9
     assert power(2, 3) == 8
Esempio n. 3
0
 def test_power(self):
     self.assertEqual(main.power(3, 3), 27, 'power fail') 
Esempio n. 4
0
	def test_power3(self):
		self.assertEqual(main.power("ynfj49 d"), False, "The power test failed on 'ynfj49 d'")
Esempio n. 5
0
	def test_power2(self):
		self.assertEqual(main.power("n"), False, "The power test failed on 'n'")
Esempio n. 6
0
	def test_power1(self):
		self.assertEqual(main.power("y"), True, "The power test failed on 'y'")
Esempio n. 7
0
 def test_power(self):
     self.assertEqual(main.power(3, 3), 27, 'power fail')