Skip to content

Commit 78cbc67

Browse files
committed
fix: make tests using 'Crunch' class works
1 parent 026fde2 commit 78cbc67

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

eodag/plugins/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# limitations under the License.
1818
from __future__ import annotations
1919

20-
from typing import TYPE_CHECKING, Any, Dict, List, Tuple
20+
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
2121

2222
from eodag.utils.exceptions import PluginNotFoundError
2323

@@ -60,7 +60,7 @@ def get_plugin_by_class_name(cls, name: str) -> EODAGPluginMount:
6060
class PluginTopic(metaclass=EODAGPluginMount):
6161
"""Base of all plugin topics in eodag"""
6262

63-
def __init__(self, provider: str, config: PluginConfig) -> None:
63+
def __init__(self, provider: Optional[str], config: PluginConfig) -> None:
6464
self.config = config
6565
self.provider = provider
6666

eodag/plugins/crunch/base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ class Crunch(PluginTopic):
3232
def __init__(self, config: Optional[Dict[str, Any]]) -> None:
3333
self.config = PluginConfig()
3434
self.config.__dict__ = config if config is not None else {}
35+
self.provider = None
36+
37+
def __repr__(self) -> str:
38+
return (
39+
f"{self.__class__.__name__}(provider=None, config={self.config}, "
40+
f"topic={self.__class__.mro()[-3].__name__})"
41+
)
3542

3643
def proceed(
3744
self, products: List[EOProduct], **search_params: Any

0 commit comments

Comments
 (0)