File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 5
5
from crawlee import service_locator
6
6
from crawlee .storages import Dataset , KeyValueStore , RequestQueue
7
7
8
- from apify import Configuration
8
+ from apify import Actor , Configuration
9
9
from apify .storage_clients import ApifyStorageClient
10
10
11
11
@@ -55,3 +55,21 @@ async def test_unnamed_default_without_config(
55
55
assert storage is storage_again
56
56
57
57
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
+ service_locator .set_storage_client (ApifyStorageClient ())
70
+ async with Actor (configure_logging = False ):
71
+ await storage_type .open (alias = 'test' )
72
+ default_kvs = await Actor .open_key_value_store (force_cloud = True )
73
+
74
+ # The default KVS should be empty
75
+ assert len (await default_kvs .list_keys ()) == 0
You can’t perform that action at this time.
0 commit comments