Commit 32b950ae authored by Antoine Laudrain's avatar Antoine Laudrain
Browse files

Correct ut_helpers_wav input file paths in pipeline.

parent 25b3de0a
Pipeline #136454 passed with stages
in 6 minutes and 29 seconds
......@@ -9,6 +9,7 @@
# pylint: disable=no-self-use
# pylint: disable=invalid-name
import os.path
import unittest as ut
import numpy as np
......@@ -17,14 +18,14 @@ from helpers_wav import (
get_time_points, process_waveform, process_sequence,
process_data_file, read_data, iter_data)
_HERE = os.path.normpath(os.path.dirname(__file__))
###############################################################################
FILE_NODAT_PATH = "test/noMatchingDat.raw"
FILE_NODAT_PATH = os.path.join(_HERE, "test/noMatchingDat.raw")
FILE_EMPTY_TIME_POINTS = np.array([])
FILE_EMPTY_WAVEFORMS = []
FILE1_PATH = "test/data1.210422_204553.CHAN1.raw"
FILE1_PATH = os.path.join(_HERE, "test/data1.210422_204553.CHAN1.raw")
FILE1_TIME_POINTS = np.array([
-4.00141125e-07, -3.99941125e-07, -3.99741125e-07, -3.99541125e-07, -3.99341125e-07
])
......@@ -34,7 +35,7 @@ FILE1_WAVEFORMS = [
np.array([ 0.00429241, 0.00418698, 0.0064538 , 0.01299068, 0.00039137])
]
FILE2_PATH = "test/data2.210422_153404.CHAN1.raw"
FILE2_PATH = os.path.join(_HERE, "test/data2.210422_153404.CHAN1.raw")
FILE2_TIME_POINTS = np.array([
-4.00183944e-07, -4.00083944e-07, -3.99983944e-07
])
......@@ -122,22 +123,26 @@ class TestProcessDataFile(ut.TestCase):
def test_wrong_extension_time_points(self):
"""If file name not ending with '.raw', should skip."""
time_points, _ = process_data_file("data/data1.210422_204553.CHAN1.dat")
time_points, _ = process_data_file(
os.path.join(_HERE, "data/data1.210422_204553.CHAN1.dat"))
np.testing.assert_equal(time_points, FILE_EMPTY_TIME_POINTS)
def test_wrong_extension_waveforms(self):
"""If file name not ending with '.raw', should skip."""
_, waveforms = process_data_file("data/data1.210422_204553.CHAN1.dat")
_, waveforms = process_data_file(
os.path.join(_HERE, "data/data1.210422_204553.CHAN1.dat"))
np.testing.assert_equal(waveforms, FILE_EMPTY_WAVEFORMS)
def test_no_raw_file_time_points(self):
"""If no raw data file, should skip."""
time_points, _ = process_data_file("data/fileNotFound.raw")
time_points, _ = process_data_file(
os.path.join(_HERE, "data/fileNotFound.raw"))
np.testing.assert_equal(time_points, FILE_EMPTY_TIME_POINTS)
def test_no_raw_file_waveforms(self):
"""If no raw data file, should skip."""
_, waveforms = process_data_file("data/fileNotFound.raw")
_, waveforms = process_data_file(
os.path.join(_HERE, "data/fileNotFound.raw"))
np.testing.assert_equal(waveforms, FILE_EMPTY_WAVEFORMS)
def test_no_matching_preamble_file_time_points(self):
......
Markdown is supported
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