def test_right_triangle(self): triangle = classify_triangle(1, 2, 5) self.assertTrue(triangle.is_right(), "Triangle is Right") self.assertTrue(triangle.is_scalene(), "Triangle is Scalene") self.assertFalse(triangle.is_equilateral(), "Triangle is NOT Equilateral") self.assertFalse(triangle.is_isosceles(), "Triangle is NOT Isosceles")
def test_str_triangle(self): triangle = classify_triangle("not", "a", "triangle") self.assertEqual(str(triangle), "Invalid")
def test_not_a_triangle(self): triangle = classify_triangle(0, 0, 0) self.assertEqual(str(triangle), "Invalid")
def test_neg_triangle_3(self): triangle = classify_triangle(1, 1, -1) self.assertEqual(str(triangle), "Invalid")
def test_equilateral_triangle(self): triangle = classify_triangle(3, 3, 3) self.assertTrue(triangle.is_equilateral(), "Triangle is Equilateral") self.assertFalse(triangle.is_scalene(), "Triangle is NOT Scalene") self.assertFalse(triangle.is_right(), "Triangle is NOT Right") self.assertFalse(triangle.is_isosceles(), "Triangle is NOT Isosceles")