@@ -10,6 +10,7 @@ def make_getrun_path_pattern(run_id: int, page_token: str) -> Pattern[str]:
1010 rf'{ re .escape ("http://localhost/api/" )} 2.\d{ re .escape (f"/jobs/runs/get?page_token={ page_token } &run_id={ run_id } " )} '
1111 )
1212
13+
1314def make_getjob_path_pattern (job_id : int , page_token : Optional [str ] = None ) -> Pattern [str ]:
1415 if page_token :
1516 return re .compile (
@@ -19,6 +20,7 @@ def make_getjob_path_pattern(job_id: int, page_token: Optional[str] = None) -> P
1920 return re .compile (
2021 rf'{ re .escape ("http://localhost/api/" )} 2.\d{ re .escape (f"/jobs/get?job_id={ job_id } " )} ' )
2122
23+
2224def make_listjobs_path_pattern (page_token : str ) -> Pattern [str ]:
2325 return re .compile (
2426 rf'{ re .escape ("http://localhost/api/" )} 2.\d{ re .escape (f"/jobs/list" )} \?(?:expand_tasks=(?:true|false)&)?page_token={ re .escape (page_token )} '
@@ -270,6 +272,7 @@ def test_get_job_pagination_with_tasks(config, requests_mock):
270272 }
271273 }
272274
275+
273276def test_list_jobs_without_task_expansion (config , requests_mock ):
274277 listjobs_page1 = {
275278 "jobs" : [{
@@ -343,6 +346,7 @@ def test_list_jobs_without_task_expansion(config, requests_mock):
343346 # only two requests should be made which are jobs/list requests
344347 assert requests_mock .call_count == 2
345348
349+
346350def test_list_jobs_with_many_tasks (config , requests_mock ):
347351 from databricks .sdk .service import compute , jobs
348352 cluster_spec = compute .ClusterSpec (spark_version = "11.3.x-scala2.12" ,
@@ -393,7 +397,8 @@ def test_list_jobs_with_many_tasks(config, requests_mock):
393397 }]
394398 }
395399 }],
396- "next_page_token" : "tokenToSecondPage"
400+ "next_page_token" :
401+ "tokenToSecondPage"
397402 }
398403 listjobs_page2 = {
399404 "jobs" : [{
0 commit comments