From 532184542de14ae79d9f01a7da9a2dc81c81f948 Mon Sep 17 00:00:00 2001 From: Casper Welzel Andersen <43357585+CasperWA@users.noreply.github.com> Date: Thu, 12 May 2022 09:41:48 +0200 Subject: [PATCH] Add Excel file to cache in test (#50) --- tests/strategies/test_parse_excel.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/strategies/test_parse_excel.py b/tests/strategies/test_parse_excel.py index 3777a9e1..624c8513 100644 --- a/tests/strategies/test_parse_excel.py +++ b/tests/strategies/test_parse_excel.py @@ -11,11 +11,13 @@ def test_parse_excel(static_files: "Path") -> None: """Test excel parse strategy.""" import dlite import numpy as np + from oteapi.datacache import DataCache from oteapi_dlite.strategies.parse_excel import DLiteExcelStrategy sample_file = static_files / "test_parse_excel.xlsx" + cache_key = DataCache().add(sample_file.read_bytes()) config = { "downloadUrl": sample_file.as_uri(), "mediaType": "application/vnd.dlite-xlsx", @@ -29,7 +31,10 @@ def test_parse_excel(static_files: "Path") -> None: } coll = dlite.Collection() - session = {"collection_id": coll.uuid} + session = { + "collection_id": coll.uuid, + "key": cache_key, + } parser = DLiteExcelStrategy(config) session.update(parser.initialize(session))