Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

merge #7

Merged
merged 3 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion shapesimilarity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .procrustesanalysis import *
from .shapesimilarity import *
from .frechetdistance import *
from .geometry import *
from .geometry import *
from .utils import *
Empty file added tests/utils/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions tests/utils/test_array_average.py
Original file line number Diff line number Diff line change
@@ -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)
9 changes: 9 additions & 0 deletions tests/utils/test_array_sum.py
Original file line number Diff line number Diff line change
@@ -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)