Skip to content

Commit a9aa5cd

Browse files
committed
normans review addressed
1 parent 4eb3a84 commit a9aa5cd

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

test/core/store/test_store.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
import pytest
88
from fsspec.registry import register_implementation
99

10-
from xcube.core.store import DataStoreError, list_data_store_ids, new_data_store
10+
from xcube.core.store import (
11+
DataStoreError,
12+
PreloadedDataStore,
13+
list_data_store_ids,
14+
new_data_store,
15+
)
16+
from xcube.core.store.preload import NullPreloadHandle
1117

1218

1319
class ListDataStoreTest(unittest.TestCase):
@@ -84,6 +90,12 @@ def test_has_data(self, mock_filesystem):
8490
self.assertEqual(mock_http_fs.exists.call_count, 3)
8591
self.assertFalse(res)
8692

93+
def test_preload_data(self):
94+
store = new_data_store("file")
95+
store_test = store.preload_data()
96+
self.assertTrue(hasattr(store_test, "preload_handle"))
97+
self.assertIsInstance(store_test.preload_handle, NullPreloadHandle)
98+
8799

88100
def test_fsspec_instantiation_error():
89101
error_string = "deliberate instantiation error for testing"

xcube/core/store/store.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def preload_data(
487487
self,
488488
*data_ids: str,
489489
**preload_params: Any,
490-
) -> "PreloadDataStore":
490+
) -> "PreloadedDataStore":
491491
"""Preload the given data items for faster access.
492492
493493
Warning: This is an experimental and potentially unstable API
@@ -704,4 +704,3 @@ def preload_handle(self) -> PreloadHandle:
704704
Implementors of this interface may use a `ExecutorPreloadHandle` or consider
705705
returning a `NullPreloadHandle` if the progress is not observable.
706706
"""
707-
pass

0 commit comments

Comments
 (0)