Skip to content

Commit

Permalink
Add Excel file to cache in test (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperWA authored May 12, 2022
1 parent b91ae82 commit 5321845
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/strategies/test_parse_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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))
Expand Down

0 comments on commit 5321845

Please sign in to comment.