From b6f9f66eefaf57bbfa1c6f9bef185c7fc82b1b79 Mon Sep 17 00:00:00 2001 From: Fernando Dantas Date: Tue, 28 Jan 2020 19:01:17 -0300 Subject: [PATCH] fix error in tests --- wavelet_tests.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/wavelet_tests.py b/wavelet_tests.py index c35a85b..1b52251 100644 --- a/wavelet_tests.py +++ b/wavelet_tests.py @@ -6,11 +6,12 @@ class OtherTests(unittest.TestCase): - def test_allocate_matrix(self): - self.assertEqual(self.w.A, None) - ans = np.zeros((self.w.m, self.w.mg)) - self.w._allocate_a_matrix() - self.assertTrue(np.array_equal(ans, self.w.A)) + def test_vstack(self): + arr1 = np.array([0, 1]) + arr2 = np.array([2, 3]) + ret = np.vstack((arr1, arr2)) + ans = np.array([[0, 1], [2, 3]]) + self.assertTrue(np.array_equal(ret, ans)) class WaveletShortTests(unittest.TestCase): @@ -22,18 +23,17 @@ def setUp(self): def test_mg(self): self.assertEqual(self.w.mg, 2) - def test_vstack(self): - arr1 = np.array([0, 1]) - arr2 = np.array([2, 3]) - ret = np.vstack((arr1, arr2)) - ans = np.array([[0, 1], [2, 3]]) - self.assertTrue(np.array_equal(ret, ans)) - def test_get_raw_4_lines(self): l0, l1 = list(self.w._get_raw_lines(self.file)) self.assertTrue(np.array_equal(l0, np.array([-1, 10]))) self.assertTrue(np.array_equal(l1, np.array([111, -1.9]))) + def test_allocate_matrix(self): + self.assertEqual(self.w.A, None) + ans = np.zeros((self.w.m, self.w.mg)) + self.w._allocate_a_matrix() + self.assertTrue(np.array_equal(ans, self.w.A)) + def test_set_a_coefficients(self): self.w = Wavelet(m=2, g=1) ans = np.array([[-1, 10], [111, -1.9]])