added exercise 1

This commit is contained in:
2025-01-16 10:47:32 +01:00
parent 6031837e82
commit 151f8492b4
2 changed files with 60 additions and 0 deletions

20
test_ex1.py Normal file
View File

@@ -0,0 +1,20 @@
import unittest
from ex1_triangles import countTriangles
class MyTestCase(unittest.TestCase):
def test_simple1(self):
self.assertEqual(
countTriangles([(0, 1), (1, 2), (0, 2)]),
1
)
def test_simple2(self):
self.assertEqual(
countTriangles([(2, 1), (1, 2), (2, 3)]),
0
)
if __name__ == '__main__':
unittest.main()