File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 55from crawlee import service_locator
66from crawlee .storages import Dataset , KeyValueStore , RequestQueue
77
8- from apify import Configuration
8+ from apify import Actor , Configuration
99from apify .storage_clients import ApifyStorageClient
1010
1111
@@ -55,3 +55,20 @@ async def test_unnamed_default_without_config(
5555 assert storage is storage_again
5656
5757 await storage .drop ()
58+
59+
60+ @pytest .mark .parametrize (
61+ 'storage_type' ,
62+ [Dataset , KeyValueStore , RequestQueue ],
63+ )
64+ async def test_aliases_not_stored_on_platform_when_local (
65+ storage_type : Dataset | KeyValueStore | RequestQueue , apify_token : str
66+ ) -> None :
67+ """Test that default Apify storage used locally is not persisting aliases to Apify based default KVS."""
68+ service_locator .set_configuration (Configuration (token = apify_token ))
69+ async with Actor (configure_logging = False ):
70+ await storage_type .open (alias = 'test' )
71+ default_kvs = await Actor .open_key_value_store (force_cloud = True )
72+
73+ # The default KVS should be empty
74+ assert len (await default_kvs .list_keys ()) == 0
You can’t perform that action at this time.
0 commit comments