Skip to content

Commit

Permalink
Added test for register_time_shift
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentRDC committed Jun 12, 2018
1 parent 62beb54 commit f15eebb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions skued/time_series/tests/test_time_zero.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ def test_shift_different_lengths(self):
trace2 = np.empty((8,))
register_time_shift(trace1, trace2)

def test_shift_not1d(self):
""" Test that register_time_shift() raises an exception if the reference or trace are not 1D """
with self.subTest('Trace not 1D'):
with self.assertRaises(ValueError):
trace1 = np.empty((16,45))
trace2 = np.empty((8,))
register_time_shift(trace1, trace2)

with self.subTest('Reference not 1D'):
with self.assertRaises(ValueError):
trace1 = np.empty((16,))
trace2 = np.empty((8,2))
register_time_shift(trace1, trace2)

class TestTimeShifts(unittest.TestCase):

def test_trivial(self):
Expand Down

0 comments on commit f15eebb

Please sign in to comment.