Skip to content

Commit

Permalink
fix error in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fmndantas committed Jan 28, 2020
1 parent a02af6b commit b6f9f66
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions wavelet_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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]])
Expand Down

0 comments on commit b6f9f66

Please sign in to comment.