MCPcopy Create free account
hub / github.com/FDio/vpp / assert_known_api_retval

Method assert_known_api_retval

test/vpp_papi_provider.py:267–278  ·  view source on GitHub ↗

Expect API to have a certain return value used with with, e.g.:: with self.vapi.assert_known_api_retval(retvals=[0,-165]): self.vapi. :note: this is useful only inside another with block as success is the default expect

(self, retvals: list[int])

Source from the content-addressed store, hash-verified

265 return self
266
267 def assert_known_api_retval(self, retvals: list[int]):
268 """Expect API to have a certain return value used with with, e.g.::
269
270 with self.vapi.assert_known_api_retval(retvals=[0,-165]):
271 self.vapi.<api call expected to succeed>
272
273 :note: this is useful only inside another with block
274 as success is the default expected value
275 """
276 self._expect_stack.append(self._expect_api_retval)
277 self._expect_api_retval = retvals
278 return self
279
280 def assert_zero_api_retval(self):
281 """Expect API success - used with with, e.g.::

Callers 2

Calls 1

appendMethod · 0.80

Tested by 1