diff --git a/shapesimilarity/__init__.py b/shapesimilarity/__init__.py index df8efbf..c56bfc8 100644 --- a/shapesimilarity/__init__.py +++ b/shapesimilarity/__init__.py @@ -1,4 +1,5 @@ from .procrustesanalysis import * from .shapesimilarity import * from .frechetdistance import * -from .geometry import * \ No newline at end of file +from .geometry import * +from .utils import * \ No newline at end of file diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/utils/test_array_average.py b/tests/utils/test_array_average.py new file mode 100644 index 0000000..ab8a667 --- /dev/null +++ b/tests/utils/test_array_average.py @@ -0,0 +1,6 @@ +from shapesimilarity import array_average +import unittest + +class TestArrayAverage(unittest.TestCase): + def test_returns_the_average_of_all_elements_in_the_array(self): + self.assertEqual(array_average([1, 3, 5]), 3) \ No newline at end of file diff --git a/tests/utils/test_array_sum.py b/tests/utils/test_array_sum.py new file mode 100644 index 0000000..474f12e --- /dev/null +++ b/tests/utils/test_array_sum.py @@ -0,0 +1,9 @@ +from shapesimilarity import array_sum +import unittest + +class TestArraySum(unittest.TestCase): + def test_returns_the_sum_of_all_elements_in_the_array(self): + self.assertEqual(array_sum([1, 3, 5]), 9) + + def test_returns_0_for_empty_arrays(self): + self.assertEqual(array_sum([]), 0) \ No newline at end of file