MCPcopy
hub / github.com/pantsbuild/pants / get

Function get

src/python/pants/testutil/engine/util.py:167–189  ·  view source on GitHub ↗
(product, subject)

Source from the content-addressed store, hash-verified

165 return res
166
167 def get(product, subject):
168 provider = next(
169 (
170 mock_get.mock
171 for mock_get in mock_gets
172 if mock_get.product_type == product
173 and (
174 mock_get.subject_type == type(subject)
175 or (
176 union_membership
177 and union_membership.is_member(mock_get.subject_type, subject)
178 )
179 )
180 ),
181 None,
182 )
183 if provider is None:
184 raise AssertionError(
185 "Rule requested: Get{}, which cannot be satisfied.".format(
186 (product, type(subject), subject)
187 )
188 )
189 return provider(subject)
190
191 rule_coroutine = res
192 rule_input = None

Callers 1

run_ruleFunction · 0.85

Calls 2

is_memberMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected