|
| 1 | +# The MIT License (MIT) |
| 2 | +# Copyright (c) 2024 by the xcube development team and contributors |
| 3 | +# |
| 4 | +# Permission is hereby granted, free of charge, to any person obtaining a |
| 5 | +# copy of this software and associated documentation files (the "Software"), |
| 6 | +# to deal in the Software without restriction, including without limitation |
| 7 | +# the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 | +# and/or sell copies of the Software, and to permit persons to whom the |
| 9 | +# Software is furnished to do so, subject to the following conditions: |
| 10 | +# |
| 11 | +# The above copyright notice and this permission notice shall be included in all |
| 12 | +# copies or substantial portions of the Software. |
| 13 | +# |
| 14 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | +# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE |
| 17 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 18 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 19 | +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 20 | +# SOFTWARE. |
| 21 | + |
| 22 | +import unittest |
| 23 | + |
| 24 | +from xcube.util.extension import ExtensionRegistry |
| 25 | +from xcube_stac.plugin import init_plugin |
| 26 | + |
| 27 | + |
| 28 | +class XcubePluginTest(unittest.TestCase): |
| 29 | + def test_plugin(self): |
| 30 | + """Assert xcube extensions registered by xcube-stac""" |
| 31 | + registry = ExtensionRegistry() |
| 32 | + init_plugin(registry) |
| 33 | + self.assertEqual( |
| 34 | + { |
| 35 | + "xcube.core.store": { |
| 36 | + "stac": { |
| 37 | + "component": "<not loaded yet>", |
| 38 | + "description": "STAC DataStore", |
| 39 | + "name": "stac", |
| 40 | + "point": "xcube.core.store", |
| 41 | + } |
| 42 | + }, |
| 43 | + "xcube.core.store.opener": { |
| 44 | + "dataset:zarr:stac": { |
| 45 | + "component": "<not loaded yet>", |
| 46 | + "description": "xarray.Dataset from STAC API", |
| 47 | + "name": "dataset:zarr:stac", |
| 48 | + "point": "xcube.core.store.opener", |
| 49 | + } |
| 50 | + }, |
| 51 | + }, |
| 52 | + registry.to_dict(), |
| 53 | + ) |
0 commit comments