def test2DSpecX(self): '''an error is raised if check_spectrum is given a 2D x input''' x = np.arange(10).reshape((2, 5)) y = np.arange(10) with self.assertRaisesRegex(ValueError, 'x is not a 1 dimensional array'): spectrum_functions.check_spectrum(x, y)
def testXYlenDifferent(self): '''an error is raised if x and y are not the same length as each other''' x = np.arange(10) y = np.arange(9) with self.assertRaisesRegex(ValueError, 'x and y are not the same length'): spectrum_functions.check_spectrum(x, y)