File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 7
7
import pytest
8
8
from fsspec .registry import register_implementation
9
9
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
11
17
12
18
13
19
class ListDataStoreTest (unittest .TestCase ):
@@ -84,6 +90,12 @@ def test_has_data(self, mock_filesystem):
84
90
self .assertEqual (mock_http_fs .exists .call_count , 3 )
85
91
self .assertFalse (res )
86
92
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
+
87
99
88
100
def test_fsspec_instantiation_error ():
89
101
error_string = "deliberate instantiation error for testing"
Original file line number Diff line number Diff line change @@ -487,7 +487,7 @@ def preload_data(
487
487
self ,
488
488
* data_ids : str ,
489
489
** preload_params : Any ,
490
- ) -> "PreloadDataStore " :
490
+ ) -> "PreloadedDataStore " :
491
491
"""Preload the given data items for faster access.
492
492
493
493
Warning: This is an experimental and potentially unstable API
@@ -704,4 +704,3 @@ def preload_handle(self) -> PreloadHandle:
704
704
Implementors of this interface may use a `ExecutorPreloadHandle` or consider
705
705
returning a `NullPreloadHandle` if the progress is not observable.
706
706
"""
707
- pass
You can’t perform that action at this time.
0 commit comments