15
15
from .conftest import ActorFactory
16
16
17
17
18
- async def test_actor_reports_running_on_platform (make_actor : ActorFactory ) -> None :
18
+ async def test_actor_reports_running_on_platform (
19
+ apify_client_async : ApifyClientAsync ,
20
+ make_actor : ActorFactory ,
21
+ ) -> None :
19
22
async def main () -> None :
20
23
async with Actor :
21
24
assert Actor .is_at_home () is True
22
25
23
26
actor = await make_actor ('is-at-home' , main_func = main )
24
27
25
28
run_result = await actor .call ()
26
-
27
29
assert run_result is not None
28
- assert run_result ['status' ] == 'SUCCEEDED'
29
30
31
+ run_client = apify_client_async .run (run_result ['id' ])
32
+ run_client_result = await run_client .wait_for_finish (wait_secs = 300 )
33
+
34
+ assert run_client_result is not None
35
+ assert run_client_result ['status' ] == 'SUCCEEDED'
30
36
31
- async def test_actor_retrieves_env_vars (make_actor : ActorFactory ) -> None :
37
+
38
+ async def test_actor_retrieves_env_vars (
39
+ apify_client_async : ApifyClientAsync ,
40
+ make_actor : ActorFactory ,
41
+ ) -> None :
32
42
async def main () -> None :
33
43
async with Actor :
34
44
env_dict = Actor .get_env ()
@@ -48,12 +58,19 @@ async def main() -> None:
48
58
actor = await make_actor ('get-env' , main_func = main )
49
59
50
60
run_result = await actor .call ()
51
-
52
61
assert run_result is not None
62
+
63
+ run_client = apify_client_async .run (run_result ['id' ])
64
+ run_client_result = await run_client .wait_for_finish (wait_secs = 300 )
65
+
66
+ assert run_client_result is not None
53
67
assert run_result ['status' ] == 'SUCCEEDED'
54
68
55
69
56
- async def test_actor_creates_new_client_instance (make_actor : ActorFactory ) -> None :
70
+ async def test_actor_creates_new_client_instance (
71
+ apify_client_async : ApifyClientAsync ,
72
+ make_actor : ActorFactory ,
73
+ ) -> None :
57
74
async def main () -> None :
58
75
import os
59
76
@@ -71,8 +88,12 @@ async def main() -> None:
71
88
actor = await make_actor ('new-client' , main_func = main )
72
89
73
90
run_result = await actor .call ()
74
-
75
91
assert run_result is not None
92
+
93
+ run_client = apify_client_async .run (run_result ['id' ])
94
+ run_client_result = await run_client .wait_for_finish (wait_secs = 300 )
95
+
96
+ assert run_client_result is not None
76
97
assert run_result ['status' ] == 'SUCCEEDED'
77
98
78
99
output_record = await actor .last_run ().key_value_store ().get_record ('OUTPUT' )
0 commit comments