Skip to content

Commit

Permalink
tests: distmatrix returns numpy datatypes
Browse files Browse the repository at this point in the history
  • Loading branch information
robertcv committed Jun 7, 2019
1 parent 6f67db7 commit 7ca69e1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Orange/tests/test_distances.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,17 @@ def test_save(self):
["danny", "eve", "frank"])
self.assertEqual(m.axis, 0)

def test_numpy_type(self):
"""
Test if for DistMatrix function returning a single element if they
are numpy datatype. This is needed for other numpy function to work.
"""
data = np.random.randint(3, 5, (3, 5))
dm1, dm2 = DistMatrix(data), DistMatrix(data)

self.assertEqual(np.int64, type(dm1.max()))
np.testing.assert_array_equal(dm1, dm2)


# noinspection PyTypeChecker
class TestEuclidean(TestCase):
Expand Down

0 comments on commit 7ca69e1

Please sign in to comment.