From 420b5dbecfd89f91429e55b1fe313225bf5f1ab0 Mon Sep 17 00:00:00 2001 From: Arne de Laat Date: Fri, 28 Jun 2024 09:27:22 +0200 Subject: [PATCH] Fix typo in keyword and update unittests --- tests/test_writer_acceptance.py | 8 ++++---- writer/storage.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_writer_acceptance.py b/tests/test_writer_acceptance.py index b260966..4a9b593 100644 --- a/tests/test_writer_acceptance.py +++ b/tests/test_writer_acceptance.py @@ -66,7 +66,7 @@ def tearDown(self): shutil.rmtree(DATASTORE_PATH / '2017') def test_event_acceptance(self): - self.writer_app.process_data(self.pickle_filename['CIC']) + self.writer_app.process_data(self.pickle_filename['CIC'], DATASTORE_PATH) data = self.read_table('events') self.assertEqual(data['timestamp'], 1488093964) @@ -86,7 +86,7 @@ def test_event_acceptance(self): self.assertEqual(tr1, base64.decodebytes(tr1_b64)) def test_singles_acceptance(self): - self.writer_app.process_data(self.pickle_filename['SIN']) + self.writer_app.process_data(self.pickle_filename['SIN'], DATASTORE_PATH) data = self.read_table('singles') self.assertEqual(data['timestamp'], 1488094031) @@ -99,7 +99,7 @@ def test_singles_acceptance(self): self.assertEqual(len(blobs), 0) def test_weather_acceptance(self): - self.writer_app.process_data(self.pickle_filename['WTR']) + self.writer_app.process_data(self.pickle_filename['WTR'], DATASTORE_PATH) data = self.read_table('weather') self.assertEqual(data['timestamp'], 1488094084) @@ -111,7 +111,7 @@ def test_weather_acceptance(self): self.assertEqual(len(blobs), 0) def test_config_acceptance(self): - self.writer_app.process_data(self.pickle_filename['CFG']) + self.writer_app.process_data(self.pickle_filename['CFG'], DATASTORE_PATH) data = self.read_table('config') self.assertEqual(data['timestamp'], 1488125225) self.assertEqual(data['mas_ch1_thres_high'], 320) diff --git a/writer/storage.py b/writer/storage.py index 61f2002..7e2061d 100644 --- a/writer/storage.py +++ b/writer/storage.py @@ -278,7 +278,7 @@ def open_or_create_file(data_dir, date): file = directory / f'{date.year}_{date.month}_{date.day}.h5' # Ensure dir and parent directories exist with mode rwxr-xr-x - directory.mkdir(mode=0o755, parents=True, exists_ok=True) + directory.mkdir(mode=0o755, parents=True, exist_ok=True) return tables.open_file(file, 'a')