Exemple #1
0
 def testRandom4(self):
     """ invalid output testing """
     with self.assertRaises(TypeError):
         classify_triangle("a", 3, 5)
Exemple #2
0
 def testRandom2(self):
     """ testing invalid values """
     self.assertEqual(classify_triangle(-5, 8, 12), "Error")
     self.assertEqual(classify_triangle(0, 2, 6), "Error")
Exemple #3
0
 def testRandom3(self):
     """ invalid output testing """
     self.assertNotEqual(classify_triangle(3, 4, 3), "Equilateral Triangle")
     self.assertNotEqual(classify_triangle(3, 3, 6), "Right Triangle")
Exemple #4
0
 def testRandom1(self):
     """ testing invalid values """
     self.assertEqual(classify_triangle(2.5, 5, 8), "Error")
     self.assertEqual(classify_triangle(650, 800, 33), "Error")
Exemple #5
0
 def testIsoscelesTriangle(self):
     """ testing isosceles triangles """
     self.assertEqual(classify_triangle(3, 3, 3), "Equilateral Triangle")
     self.assertEqual(classify_triangle(3, 4, 5), "Right Triangle")
     self.assertEqual(classify_triangle(3, 4, 3), "Isosceles Triangle")
Exemple #6
0
 def testScaleneTriangle(self):
     """ testing scalene triangles """
     self.assertEqual(classify_triangle(3, 5, 7), "Scalene Triangle")
Exemple #7
0
 def testEquilateralTriangle(self):
     """ testing equilateral triangles """
     self.assertEqual(classify_triangle(1, 1, 1), "Equilateral Triangle")
     self.assertEqual(classify_triangle(2, 2, 2), "Equilateral Triangle")
     self.assertEqual(classify_triangle(5, 5, 5), "Equilateral Triangle")
Exemple #8
0
 def testRightTriangle(self):
     """ testing right triangles """
     self.assertEqual(classify_triangle(3, 4, 5), "Right Triangle")
     self.assertEqual(classify_triangle(5, 3, 4), "Right Triangle")