From f380ab510720d34129cbe498de80de494e645c6f Mon Sep 17 00:00:00 2001 From: Jacques Grelet <jacques.grelet@gmail.cpm> Date: Mon, 9 May 2022 08:21:04 -0300 Subject: [PATCH] update tests --- config.toml | 4 ++-- tests/test_config.py | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/config.toml b/config.toml index 83d3c19..5b22c58 100644 --- a/config.toml +++ b/config.toml @@ -27,7 +27,7 @@ CREATOR = "Jacques.Grelet@ird.fr" [ctd] # extract profile/station number from fileName -#station = 'fr29(\d{3})' +station = 'fr29(\d{3})' titleSummary = "CTD profiles processed during PIRATA-FR29 cruise" typeInstrument = "SBE911+" instrumentNumber = "09P1263" @@ -165,7 +165,7 @@ comment = "Extract from .edf files" [xbt.header] endHeader = '^Depth\s*\(m\)' - #station = 'Sequence\s*#\s*:\s*(\d*)' + station = 'Sequence\s*#\s*:\s*(\d*)' TIME = 'Time of Launch\s*[:=]\s*(\d+):(\d+):(\d+)' DATE = 'Date of Launch\s*[:=]\s*(\d+)/(\d+)/(\d+)' DATETIME = 'System UpLoad Time\s*=\s*(\w+)\s+(\d+)\s+(\d+)\s+(\d+):(\d+):(\d+)' diff --git a/tests/test_config.py b/tests/test_config.py index 302c145..9d1b456 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -38,8 +38,7 @@ class testConfig(unittest.TestCase): 'PI': 'BOURLES', 'CREATOR': 'Jacques.Grelet@ird.fr'} - self.ctd = {'cruisePrefix': 'fr29', - 'stationPrefixLength': 3, + self.ctd = {'station': 'fr29(\d{3})', 'titleSummary': 'CTD profiles processed during PIRATA-FR29 cruise', 'typeInstrument': 'SBE911+', 'instrumentNumber': '09P1263', @@ -58,8 +57,7 @@ class testConfig(unittest.TestCase): 'operator': 'Operator\s*:\s*(.*)', 'type': 'Type\s*:\s*(.*)'} - self.xbt = {'cruisePrefix': "fr29", - 'stationPrefixLength': 3, + self.xbt = {'station': '[CT]\d+_(\d{5})', 'typeInstrument': "SIPPICAN+", 'instrumentNumber': "N/A", 'acquisitionSoftware': "WinMK21", @@ -155,7 +153,7 @@ class testConfig(unittest.TestCase): def test_split_xbt(self): """ Test if all value in block [split.xbt] are correct """ - d = self.cfg['split']['xbt'] + d = self.cfg['xbt']['split'] for k in d.keys(): self.assertEqual(d[k], self.splitXbt[k]) -- GitLab