From 8d1be5bc65697a7075d48aebe1f8f534b9e9be47 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Thu, 21 Nov 2024 22:17:24 +1100 Subject: [PATCH] * tests/test_polygons.py: New test. --- tests/test_polygons.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/test_polygons.py diff --git a/tests/test_polygons.py b/tests/test_polygons.py new file mode 100644 index 00000000..b0189ea5 --- /dev/null +++ b/tests/test_polygons.py @@ -0,0 +1,22 @@ +# Copyright (C) 2024 Ben Elliston +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +"""A testsuite for the polygons.py module.""" + +import unittest + +from nemo import polygons + + +class TestPolygons(unittest.TestCase): + """Tests for polygons.py.""" + + def test_centroid(self): + """Test _centroid function.""" + notclosed = [(1, 1), (0, 0), (1, 2), (3, 3)] + with self.assertRaises(ValueError): + polygons._centroid(notclosed)