@@ -67,7 +67,6 @@ async def test_aliases_not_stored_on_platform_when_local(
67
67
) -> None :
68
68
"""Test that default Apify storage used locally is not persisting aliases to Apify based default KVS."""
69
69
service_locator .set_configuration (Configuration (token = apify_token ))
70
- service_locator .set_storage_client (ApifyStorageClient ())
71
70
async with Actor (configure_logging = False ):
72
71
await storage_type .open (alias = 'test' )
73
72
default_kvs = await Actor .open_key_value_store (force_cloud = True )
@@ -111,23 +110,12 @@ async def test_actor_full_explicit_storage_init_same_client(apify_token: str) ->
111
110
async def test_actor_partial_explicit_cloud_storage_init (apify_token : str ) -> None :
112
111
service_locator .set_configuration (Configuration (token = apify_token ))
113
112
service_locator .set_storage_client (ApifyStorageClient (request_queue_access = 'shared' ))
114
- async with Actor :
115
- # If service locator was already set with ApifyStorageClient, the actor will use it as cloud_storage_client of
116
- # SmartApifyStorageClient
117
- assert await Actor .open_dataset () is not await Actor .open_dataset (force_cloud = True )
118
- assert await Actor .open_key_value_store () is not await Actor .open_key_value_store (force_cloud = True )
119
- assert await Actor .open_request_queue () is not await Actor .open_request_queue (force_cloud = True )
120
-
121
-
122
- async def test_actor_partial_explicit_local_storage_init (apify_token : str ) -> None :
123
- service_locator .set_configuration (Configuration (token = apify_token ))
124
- service_locator .set_storage_client (MemoryStorageClient ())
125
- async with Actor :
126
- # If service locator was already set with non-ApifyStorageClient, the actor will use it as local_storage_client
127
- # of SmartApifyStorageClient
128
- assert await Actor .open_dataset () is not await Actor .open_dataset (force_cloud = True )
129
- assert await Actor .open_key_value_store () is not await Actor .open_key_value_store (force_cloud = True )
130
- assert await Actor .open_request_queue () is not await Actor .open_request_queue (force_cloud = True )
113
+ with pytest .raises (
114
+ RuntimeError , match = r'^The storage client in the service locator has to be instance of SmartApifyStorageClient'
115
+ ):
116
+ async with Actor :
117
+ # If service locator was explicitly set to something different than SmartApifyStorageClient, raise an error.
118
+ ...
131
119
132
120
133
121
async def test_actor_implicit_storage_init (apify_token : str ) -> None :
0 commit comments