def test_volume(self): self.assertEqual(problem1.volume(2), 8) self.assertEqual(problem1.volume(1), 1) self.assertEqual(problem1.volume(5), 125) self.assertEqual(problem1.volume(.25), 0.015625)
def test_volume_type_error(self): with self.assertRaises(TypeError): problem1.volume('a') problem1.volume("Hello");
def test_volume_value_error(self): with self.assertRaises(ValueError): problem1.volume(0) problem1.volume(-5)
def test_volume1(self): self.assertEqual(volume(0,1,12), None)
def test_volume(self): self.assertEqual(volume(2, 1.6,1), 3.2)
def test_volume2(self): self.assertEqual(volume(1,-1,5), None)