@@ -50,8 +50,8 @@ defmodule Core.Unit.Policies.AppPolicyTest do
5050 end
5151 end
5252
53- describe "is_valid ?" do
54- test "is_valid ? should return true when invalidate options are :infinity and the worker can host the function" ,
53+ describe "valid ?" do
54+ test "valid ? should return true when invalidate options are :infinity and the worker can host the function" ,
5555 % { impl: app_impl } do
5656 wrk = % Worker {
5757 name: "worker@localhost" ,
@@ -73,15 +73,15 @@ defmodule Core.Unit.Policies.AppPolicyTest do
7373 invalidate_capacity = :infinity
7474 invalidate_invocations = :infinity
7575
76- assert app_impl . is_valid ?(
76+ assert app_impl . valid ?(
7777 wrk ,
7878 function ,
7979 invalidate_capacity ,
8080 invalidate_invocations
8181 ) == true
8282 end
8383
84- test "is_valid ? should return true when invalidate options are satisfied and the worker can host the function" ,
84+ test "valid ? should return true when invalidate options are satisfied and the worker can host the function" ,
8585 % { impl: app_impl } do
8686 wrk = % Worker {
8787 name: "worker@localhost" ,
@@ -103,15 +103,15 @@ defmodule Core.Unit.Policies.AppPolicyTest do
103103 invalidate_capacity = 50
104104 invalidate_invocations = 1
105105
106- assert app_impl . is_valid ?(
106+ assert app_impl . valid ?(
107107 wrk ,
108108 function ,
109109 invalidate_capacity ,
110110 invalidate_invocations
111111 ) == true
112112 end
113113
114- test "is_valid ? should return false when invalidate options are :infinity and the worker can't host the function" ,
114+ test "valid ? should return false when invalidate options are :infinity and the worker can't host the function" ,
115115 % { impl: app_impl } do
116116 wrk = % Worker {
117117 name: "worker@localhost" ,
@@ -133,15 +133,15 @@ defmodule Core.Unit.Policies.AppPolicyTest do
133133 invalidate_capacity = :infinity
134134 invalidate_invocations = :infinity
135135
136- assert app_impl . is_valid ?(
136+ assert app_impl . valid ?(
137137 wrk ,
138138 function ,
139139 invalidate_capacity ,
140140 invalidate_invocations
141141 ) == false
142142 end
143143
144- test "is_valid ? should return false when invalidate options are not satisfied or the worker can't host the function" ,
144+ test "valid ? should return false when invalidate options are not satisfied or the worker can't host the function" ,
145145 % { impl: app_impl } do
146146 wrk = % Worker {
147147 name: "worker@localhost" ,
@@ -163,21 +163,21 @@ defmodule Core.Unit.Policies.AppPolicyTest do
163163 invalidate_capacity = 49
164164 invalidate_invocations = 1
165165
166- assert app_impl . is_valid ?(
166+ assert app_impl . valid ?(
167167 wrk ,
168168 function ,
169169 invalidate_capacity ,
170170 invalidate_invocations
171171 ) == false
172172
173- assert app_impl . is_valid ?(
173+ assert app_impl . valid ?(
174174 wrk |> Map . put ( :concurrent_functions , 1 ) ,
175175 function ,
176176 invalidate_capacity ,
177177 invalidate_invocations
178178 ) == false
179179
180- assert app_impl . is_valid ?(
180+ assert app_impl . valid ?(
181181 wrk |> Map . put ( :resources , % Metrics { memory: % { available: 127 , total: 256 } } ) ,
182182 function ,
183183 invalidate_capacity ,
@@ -266,7 +266,7 @@ defmodule Core.Unit.Policies.AppPolicyTest do
266266 function: function
267267 } do
268268 assert app_impl . select ( script , workers , function ) == { :ok , wrk }
269- assert app_impl . is_valid ?( wrk , function , :infinity , :infinity )
269+ assert app_impl . valid ?( wrk , function , :infinity , :infinity )
270270
271271 # invalidating the first worker causes select() to choose "worker2"
272272 workers_invalid_first = [
@@ -279,13 +279,13 @@ defmodule Core.Unit.Policies.AppPolicyTest do
279279 ]
280280
281281 assert app_impl . select ( script , workers_invalid_first , function ) == { :ok , wrk2 }
282- assert app_impl . is_valid ?( wrk2 , function , :infinity , :infinity )
282+ assert app_impl . valid ?( wrk2 , function , :infinity , :infinity )
283283 end
284284
285285 test "select should return a valid worker in the script when the strategy is :random" ,
286286 % { impl: app_impl , workers: workers , script: script , function: function } do
287287 { :ok , wrk } = app_impl . select ( script , workers , function )
288- assert app_impl . is_valid ?( wrk , function , :infinity , :infinity )
288+ assert app_impl . valid ?( wrk , function , :infinity , :infinity )
289289 assert Enum . member? ( workers , wrk ) == true
290290 end
291291
@@ -305,7 +305,7 @@ defmodule Core.Unit.Policies.AppPolicyTest do
305305 { :ok , wrk } = app_impl . select ( platform_script , workers , function )
306306 { :ok , wrk_default } = default_impl . select ( % Data.Configurations.Empty { } , workers , function )
307307
308- assert app_impl . is_valid ?( wrk , function , :infinity , :infinity )
308+ assert app_impl . valid ?( wrk , function , :infinity , :infinity )
309309 assert Enum . member? ( workers , wrk ) == true
310310 assert wrk_default == wrk
311311 end
0 commit comments