import unittest

from triangle import is_equilateral, is_isosceles, is_scalene


# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0

class is_equilateralTests(unittest.TestCase):
    def test_true_if_all_sides_are_equal(self):
        self.assertIs(is_equilateral([2, 2, 2]), True)

    def test_false_if_any_side_is_unequal(self):
        self.assertIs(is_equilateral([2, 3, 2]), False)

    def test_false_if_no_sides_are_equal(self):
        self.assertIs(is_equilateral([5, 4, 6]), False)

    def test_false_if_all_sides_are_zero(self):
        self.assertIs(is_equilateral([0, 0, 0]), False)

    def test_sides_may_be_floats(self):
        self.assertIs(is_equilateral([0.5, 0.5, 0.5]), True)


class is_isoscelesTests(unittest.TestCase):
    def test_true_if_last_two_sides_are_equal(self):
        self.assertIs(is_isosceles([3, 4, 4]), True)

    def test_true_if_first_two_sides_are_equal(self):
        self.assertIs(is_isosceles([4, 4, 3]), True)

    def test_true_if_first_and_last_sides_are_equal(self):
        self.assertIs(is_isosceles([4, 3, 4]), True)

    def test_is_equilateral_triangles_are_also_is_isosceles(self):
        self.assertIs(is_isosceles([4, 4, 4]), True)

    def test_false_if_no_sides_are_equal(self):
        self.assertIs(is_isosceles([2, 3, 4]), False)

    def test_violation_of_triangle_inequality_is_not_isosceles_1(self):
        self.assertIs(is_isosceles([1, 1, 3]), False)

    def test_violation_of_triangle_inequality_is_not_isosceles_2(self):
        self.assertIs(is_isosceles([1, 3, 1]), False)

    def test_violation_of_triangle_inequality_is_not_isosceles_3(self):
        self.assertIs(is_isosceles([3, 1, 1]), False)

    def test_sides_may_be_floats(self):
        self.assertIs(is_isosceles([0.5, 0.4, 0.5]), True)


class is_scaleneTests(unittest.TestCase):
    def test_true_if_no_sides_are_equal(self):
        self.assertIs(is_scalene([5, 4, 6]), True)

    def test_false_if_all_sides_are_equal(self):
        self.assertIs(is_scalene([4, 4, 4]), False)

    def test_false_if_two_sides_are_equal(self):
        self.assertIs(is_scalene([4, 4, 3]), False)

    def test_violation_of_triangle_inequality_not_is_scalene(self):
        self.assertIs(is_scalene([7, 3, 2]), False)

    def test_sides_may_be_floats(self):
        self.assertIs(is_scalene([0.5, 0.4, 0.6]), True)


if __name__ == '__main__':
    unittest.main()

@@ -148,17 +148,17 @@
  @ v1.2.
-0
+1
 %0A%0Aclass 
@@ -210,24 +210,16 @@
 ef test_
-true_if_
 all_side
@@ -306,25 +306,16 @@
 ef test_
-false_if_
 any_side
@@ -399,33 +399,24 @@
    def test_
-false_if_
 no_sides_are
@@ -503,35 +503,40 @@
 est_
-f
 al
-se_if_all_sides_are_zero
+l_zero_sides_is_not_a_triangle
 (sel
@@ -756,24 +756,16 @@
 ef test_
-true_if_
 last_two
@@ -851,32 +851,24 @@
    def test_
-true_if_
 first_two_si
@@ -955,24 +955,16 @@
 ef test_
-true_if_
 first_an
@@ -1060,19 +1060,16 @@
 ef test_
-is_
 equilate
@@ -1091,19 +1091,16 @@
 re_also_
-is_
 isoscele
@@ -1175,25 +1175,16 @@
 ef test_
-false_if_
 no_sides
@@ -1265,36 +1265,29 @@
    def test_
-violation_of
+first
 _triangle_in
@@ -1299,26 +1299,17 @@
 ity_
-is_not_isosceles_1
+violation
 (sel
@@ -1376,36 +1376,30 @@
    def test_
-violation_of
+second
 _triangle_in
@@ -1411,26 +1411,17 @@
 ity_
-is_not_isosceles_2
+violation
 (sel
@@ -1488,36 +1488,29 @@
    def test_
-violation_of
+third
 _triangle_in
@@ -1522,26 +1522,17 @@
 ity_
-is_not_isosceles_3
+violation
 (sel
@@ -1750,16 +1750,8 @@
 est_
-true_if_
 no_s
@@ -1837,25 +1837,16 @@
 ef test_
-false_if_
 all_side
@@ -1934,17 +1934,8 @@
 est_
-false_if_
 two_
@@ -2027,20 +2027,23 @@
 est_
-violation_of
+may_not_violate
 _tri
@@ -2062,23 +2062,8 @@
 lity
-_not_is_scalene
 (sel

update tests to v1.2.1 (#1757) (#1769)