4
4
5
5
import pytest
6
6
7
+ import fsspec
8
+ from fsspec .implementations .zip import ZipFileSystem
7
9
from fsspec .registry import (
8
10
_registry ,
9
11
filesystem ,
@@ -69,12 +71,16 @@ def test_register_fail(clear_registry):
69
71
with pytest .raises (ImportError ):
70
72
get_filesystem_class ("test" )
71
73
74
+ # NOOP
75
+ register_implementation ("test" , "doesntexist.AbstractFileSystem" , clobber = False )
72
76
with pytest .raises (ValueError ):
73
- register_implementation ("test" , "doesntexist.AbstractFileSystem" , clobber = False )
77
+ register_implementation (
78
+ "test" , "doesntexist.AbstractFileSystemm" , clobber = False
79
+ )
74
80
75
81
# by default we do not allow clobbering
76
82
with pytest .raises (ValueError ):
77
- register_implementation ("test" , "doesntexist.AbstractFileSystem " )
83
+ register_implementation ("test" , "doesntexist.AbstractFileSystemm " )
78
84
79
85
register_implementation (
80
86
"test" , "doesntexist.AbstractFileSystem" , errtxt = "hiho" , clobber = True
@@ -84,9 +90,12 @@ def test_register_fail(clear_registry):
84
90
assert "hiho" in str (e .value )
85
91
register_implementation ("test" , AbstractFileSystem )
86
92
93
+ # NOOP
94
+ register_implementation ("test" , AbstractFileSystem )
87
95
with pytest .raises (ValueError ):
88
- register_implementation ("test" , AbstractFileSystem )
96
+ register_implementation ("test" , ZipFileSystem )
89
97
register_implementation ("test" , AbstractFileSystem , clobber = True )
98
+ assert isinstance (fsspec .filesystem ("test" ), AbstractFileSystem )
90
99
91
100
92
101
def test_entry_points_registered_on_import (clear_registry , clean_imports ):
0 commit comments