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])
| 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.:: |