Coverage for oc_ds_converter / oc_idmanager / oc_data_storage / storage_manager.py: 67%

21 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-03-25 18:06 +0000

1# SPDX-FileCopyrightText: 2023 Arianna Moretti <arianna.moretti4@unibo.it> 

2# SPDX-FileCopyrightText: 2026 Arcangelo Massari <arcangelo.massari@unibo.it> 

3# 

4# SPDX-License-Identifier: ISC 

5 

6 

7from abc import ABCMeta 

8 

9 

10class StorageManager(metaclass=ABCMeta): 

11 """This is the interface that must be implemented by any Storage manager 

12 for a particular storage approach. It provides the signatures of the methods 

13 for string and retrieving data.""" 

14 

15 _headers: dict[str, str] 

16 

17 def __init__(self, **params: object) -> None: 

18 """Storage manager constructor.""" 

19 for key in params: 

20 setattr(self, key, params[key]) 

21 

22 self._headers = { 

23 "User-Agent": "Identifier Manager / OpenCitations Indexes " 

24 "(http://opencitations.net; mailto:contact@opencitations.net)" 

25 } 

26 

27 def set_value(self, id: str, value: bool) -> None: 

28 pass 

29 

30 def set_full_value(self, id: str, value: dict[str, str | bool | object]) -> None: 

31 pass 

32 

33 def get_value(self, id: str) -> bool | None: 

34 pass 

35 

36 def set_multi_value(self, list_of_tuples: list[tuple[str, bool]]) -> None: 

37 pass 

38 

39 def delete_storage(self) -> None: 

40 pass 

41 

42 def store_file(self) -> None: 

43 pass 

44 

45 def get_all_keys(self) -> list[str]: 

46 return [] 

47