@@ -113,3 +113,53 @@ async def test_actor_create_update_delete(apify_client_async: ApifyClientAsync)
113113 # Verify deletion
114114 deleted_actor = await actor_client .get ()
115115 assert deleted_actor is None
116+
117+
118+ async def test_actor_default_build (apify_client_async : ApifyClientAsync ) -> None :
119+ """Test getting an actor's default build."""
120+ # Use a public actor that has builds
121+ actor_client = apify_client_async .actor ('apify/hello-world' )
122+
123+ # Get default build client
124+ build_client = await actor_client .default_build ()
125+ assert build_client is not None
126+
127+ # Use the returned client to get the build
128+ build = await build_client .get ()
129+ assert build is not None
130+ assert build .id is not None
131+ assert build .status is not None
132+
133+
134+ async def test_actor_last_run (apify_client_async : ApifyClientAsync ) -> None :
135+ """Test getting an actor's last run."""
136+ # First run an actor to ensure there is a last run
137+ actor_client = apify_client_async .actor ('apify/hello-world' )
138+ run = await actor_client .call ()
139+ assert run is not None
140+
141+ try :
142+ # Get last run client
143+ last_run_client = actor_client .last_run ()
144+ assert last_run_client is not None
145+
146+ # Use the returned client to get the run
147+ last_run = await last_run_client .get ()
148+ assert last_run is not None
149+ assert last_run .id is not None
150+ # The last run should be the one we just created
151+ assert last_run .id == run .id
152+
153+ finally :
154+ # Cleanup
155+ await apify_client_async .run (run .id ).delete ()
156+
157+
158+ async def test_actor_validate_input (apify_client_async : ApifyClientAsync ) -> None :
159+ """Test validating actor input."""
160+ # Use a public actor with an input schema
161+ actor_client = apify_client_async .actor ('apify/hello-world' )
162+
163+ # Valid input (hello-world accepts empty input or simple input)
164+ is_valid = await actor_client .validate_input ({})
165+ assert is_valid is True
0 commit comments