Skip to content

Commit dc7f0a7

Browse files
committed
fix test_generate_public_url_for_kvs_record
1 parent 168e744 commit dc7f0a7

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

tests/integration/test_actor_key_value_store.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import os
34
from typing import TYPE_CHECKING
45

56
from apify_shared.consts import ApifyEnvVars
@@ -205,7 +206,19 @@ async def main() -> None:
205206

206207
async with Actor:
207208
public_api_url = Actor.config.api_public_base_url
208-
default_store_id = Actor.config.default_key_value_store_id
209+
210+
default_kvs_id = (
211+
os.environ.get(
212+
'ACTOR_DEFAULT_KEY_VALUE_STORE_ID',
213+
None,
214+
)
215+
or os.environ.get(
216+
'APIFY_DEFAULT_KEY_VALUE_STORE_ID',
217+
None,
218+
)
219+
or 'default'
220+
)
221+
209222
record_key = 'public-record-key'
210223

211224
kvs = await Actor.open_key_value_store()
@@ -221,7 +234,7 @@ async def main() -> None:
221234
signature = create_hmac_signature(url_signing_secret_key, record_key)
222235
assert (
223236
record_url
224-
== f'{public_api_url}/v2/key-value-stores/{default_store_id}/records/{record_key}?signature={signature}'
237+
== f'{public_api_url}/v2/key-value-stores/{default_kvs_id}/records/{record_key}?signature={signature}'
225238
)
226239

227240
actor = await make_actor(label='kvs-get-public-url', main_func=main)

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)