Commit b3ebab8c authored by Olivier Bertrand's avatar Olivier Bertrand
Browse files

Update comparing test

parent 2f8f368f
......@@ -2,7 +2,6 @@ import unittest
import numpy as np
import navipy.database as database
import navipy.comparing as comparing
from navipy.processing.tools import is_numeric_array
import pkg_resources
......@@ -53,7 +52,6 @@ class TestCase(unittest.TestCase):
# self.assertTrue(diff.shape[1] == 1)
self.assertTrue(diff.shape[0] > 0)
self.assertFalse(np.any(np.isnan(diff)))
self.assertTrue(is_numeric_array(diff))
def test_imagediff_memory(self):
"""
......@@ -94,7 +92,6 @@ class TestCase(unittest.TestCase):
self.assertFalse(diff.shape[0] <= 0)
# self.assertTrue(diff.shape[1] == 1)
self.assertFalse(np.any(np.isnan(diff)))
self.assertTrue(is_numeric_array(diff))
def test_rot_imagediff_curr(self):
"""
......@@ -135,7 +132,6 @@ class TestCase(unittest.TestCase):
self.assertFalse(diff.shape[0] <= 0)
self.assertTrue(diff.shape[1] == 4)
self.assertFalse(np.any(np.isnan(diff)))
self.assertTrue(is_numeric_array(diff))
def test_rotimagediff_memory(self):
"""
......@@ -176,7 +172,6 @@ class TestCase(unittest.TestCase):
self.assertFalse(diff.shape[0] <= 0)
self.assertTrue(diff.shape[1] == 4)
self.assertFalse(np.any(np.isnan(diff)))
self.assertTrue(is_numeric_array(diff))
def test_simple_imagediff_curr(self):
"""
......@@ -217,9 +212,7 @@ class TestCase(unittest.TestCase):
self.assertFalse(diff.shape[0] <= 0)
self.assertTrue(diff.shape[1] > 0)
self.assertFalse(np.any(np.isnan(diff)))
self.assertTrue(is_numeric_array(diff))
self.assertTrue(diff.shape[2] == 4)
# self.assertTrue(diff.shape[3] == 1)
def test_simple_imagediff_mem(self):
"""
......@@ -260,9 +253,7 @@ class TestCase(unittest.TestCase):
self.assertFalse(diff.shape[0] <= 0)
self.assertTrue(diff.shape[1] > 0)
self.assertFalse(np.any(np.isnan(diff)))
self.assertTrue(is_numeric_array(diff))
self.assertTrue(diff.shape[2] == 4)
# self.assertTrue(diff.shape[3] == 1)
def test_diff_optic_flow_memory(self):
"""
......@@ -302,7 +293,6 @@ class TestCase(unittest.TestCase):
vec = comparing.diff_optic_flow(curr, s)
self.assertFalse(vec.shape[1] == (1, 2))
self.assertFalse(np.any(np.isnan(vec)))
self.assertTrue(is_numeric_array(vec))
def test_diff_optic_flow_curr(self):
"""
......@@ -342,12 +332,11 @@ class TestCase(unittest.TestCase):
vec = comparing.diff_optic_flow(s, curr)
self.assertFalse(vec.shape[1] == (1, 2))
self.assertFalse(np.any(np.isnan(vec)))
self.assertTrue(is_numeric_array(vec))
def test_weighted_irdf(self):
for i, j, k in [([1,2,3],7, [4.0,3, 2.0]), ([3.0,'w',4],'w', ['w', 7.0, 4]), (3, [3.0, 2, 8.0], 7)]:
for i, j, k in [([1, 2, 3], 7, [4.0, 3, 2.0]), ([3.0, 'w', 4], 'w', ['w', 7.0, 4]), (3, [3.0, 2, 8.0], 7)]:
with self.assertRaises(TypeError):
comparing.weighted_irdf(i,j,k)
comparing.weighted_irdf(i, j, k)
if __name__ == '__main__':
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment