@@ -23,26 +23,22 @@ def test_get_run_with_no_pagination(config, requests_mock):
2323
2424def test_get_run_pagination_with_tasks (config , requests_mock ):
2525 from databricks .sdk .service import compute , jobs
26- cluster_spec = compute .ClusterSpec (spark_version = "11.3.x-scala2.12" , custom_tags = {"ResourceClass" : "SingleNode" },
27- num_workers = 0 , node_type_id = "Standard_DS3_v2" , )
28- cluster1 = jobs .JobCluster (job_cluster_key = "cluster1" ,
29- new_cluster = cluster_spec )
30- cluster2 = jobs .JobCluster (job_cluster_key = "cluster2" ,
31- new_cluster = cluster_spec )
32- cluster3 = jobs .JobCluster (job_cluster_key = "cluster3" ,
33- new_cluster = cluster_spec )
34- cluster4 = jobs .JobCluster (job_cluster_key = "cluster4" ,
35- new_cluster = cluster_spec )
26+ cluster_spec = compute .ClusterSpec (spark_version = "11.3.x-scala2.12" ,
27+ custom_tags = {"ResourceClass" : "SingleNode" },
28+ num_workers = 0 ,
29+ node_type_id = "Standard_DS3_v2" ,
30+ )
31+ cluster1 = jobs .JobCluster (job_cluster_key = "cluster1" , new_cluster = cluster_spec )
32+ cluster2 = jobs .JobCluster (job_cluster_key = "cluster2" , new_cluster = cluster_spec )
33+ cluster3 = jobs .JobCluster (job_cluster_key = "cluster3" , new_cluster = cluster_spec )
34+ cluster4 = jobs .JobCluster (job_cluster_key = "cluster4" , new_cluster = cluster_spec )
3635 run1 = {
3736 "tasks" : [{
3837 "run_id" : 0
3938 }, {
4039 "run_id" : 1
4140 }],
42- "job_clusters" : [
43- cluster1 .as_dict (),
44- cluster2 .as_dict (),
45- ],
41+ "job_clusters" : [cluster1 .as_dict (), cluster2 .as_dict (), ],
4642 "job_parameters" : [{
4743 "name" : "param1" ,
4844 "value" : "value1"
@@ -55,21 +51,14 @@ def test_get_run_pagination_with_tasks(config, requests_mock):
5551 }, {
5652 "run_id" : 3
5753 }],
58- "job_clusters" : [
59- cluster3 .as_dict (),
60- cluster4 .as_dict (),
61- ],
54+ "job_clusters" : [cluster3 .as_dict (), cluster4 .as_dict (), ],
6255 "job_parameters" : [{
6356 "name" : "param2" ,
6457 "value" : "value2"
6558 }],
6659 "next_page_token" : "tokenToThirdPage" ,
6760 }
68- run3 = {
69- "tasks" : [{
70- "run_id" : 4
71- }]
72- }
61+ run3 = {"tasks" : [{"run_id" : 4 }]}
7362 requests_mock .get (make_path_pattern (1337 , "initialToken" ), text = json .dumps (run1 ))
7463 requests_mock .get (make_path_pattern (1337 , "tokenToSecondPage" ), text = json .dumps (run2 ))
7564 requests_mock .get (make_path_pattern (1337 , "tokenToThirdPage" ), text = json .dumps (run3 ))
@@ -89,12 +78,10 @@ def test_get_run_pagination_with_tasks(config, requests_mock):
8978 }, {
9079 'run_id' : 4
9180 }],
92- "job_clusters" : [
93- cluster1 .as_dict (),
94- cluster2 .as_dict (),
95- cluster3 .as_dict (),
96- cluster4 .as_dict ()
97- ],
81+ "job_clusters" : [cluster1 .as_dict (),
82+ cluster2 .as_dict (),
83+ cluster3 .as_dict (),
84+ cluster4 .as_dict ()],
9885 "job_parameters" : [{
9986 "name" : "param1" ,
10087 "value" : "value1"
@@ -128,14 +115,7 @@ def test_get_run_pagination_with_iterations(config, requests_mock):
128115 }],
129116 "next_page_token" : "tokenToThirdPage" ,
130117 }
131- run3 = {
132- "tasks" : [{
133- "run_id" : 1337
134- }],
135- "iterations" : [{
136- "run_id" : 4
137- }],
138- }
118+ run3 = {"tasks" : [{"run_id" : 1337 }], "iterations" : [{"run_id" : 4 }], }
139119 requests_mock .get (make_path_pattern (1337 , "initialToken" ), text = json .dumps (run1 ))
140120 requests_mock .get (make_path_pattern (1337 , "tokenToSecondPage" ), text = json .dumps (run2 ))
141121 requests_mock .get (make_path_pattern (1337 , "tokenToThirdPage" ), text = json .dumps (run3 ))
0 commit comments