Coverage for tests/test_plugin.py: 100%

20 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-03-11 16:56 +0100

1from typing import Optional, Type 

2from snakemake_interface_storage_plugins.tests import TestStorageBase 

3from snakemake_interface_storage_plugins.storage_provider import StorageProviderBase 

4from snakemake_interface_storage_plugins.settings import StorageProviderSettingsBase 

5from snakemake_storage_plugin_orcestra import StorageProvider, StorageProviderSettings 

6 

7class TestStorage(TestStorageBase): 

8 __test__ = True 

9 # set to True if the storage is read-only 

10 retrieve_only = True 

11 # set to True if the storage is write-only 

12 store_only = False 

13 # set to False if the storage does not support deletion 

14 delete = False 

15 # set to True if the storage object implements support for touching (inherits from 

16 # StorageObjectTouch) 

17 touch = False 

18 # set to False if also directory upload/download should be tested (if your plugin 

19 # supports directory down-/upload, definitely do that) 

20 files_only = True 

21 

22 def get_query(self, tmp_path) -> str: 

23 # Return a query. If retrieve_only is True, this should be a query that 

24 # is present in the storage, as it will not be created. 

25 return "orcestra://pharmacosets/GRAY_2013" 

26 

27 def get_query_not_existing(self, tmp_path) -> str: 

28 # Return a query that is not present in the storage. 

29 return "orcestra://pharmacosets/CCLE_2015_not_existing" 

30 

31 def get_storage_provider_cls(self) -> Type[StorageProviderBase]: 

32 # Return the StorageProvider class of this plugin 

33 return StorageProvider 

34 

35 def get_storage_provider_settings(self) -> Optional[StorageProviderSettingsBase]: 

36 # instantiate StorageProviderSettings of this plugin as appropriate 

37 return StorageProviderSettings()