| 264 | |
| 265 | # this callback does not verify the order of entries, only that all of them were present |
| 266 | class CheckStreamEntriesEqualityCallback(CheckKeyEntriesInStreamCallback): |
| 267 | def __call__( |
| 268 | self, |
| 269 | key: api.Pointer, |
| 270 | row: dict[str, api.Value], |
| 271 | time: int, |
| 272 | is_addition: bool, |
| 273 | ) -> Any: |
| 274 | q = self.state.get(key) |
| 275 | assert ( |
| 276 | q |
| 277 | ), f"Got unexpected entry {key=} {row=} {time=} {is_addition=}, expected entries= {self.state!r}" |
| 278 | |
| 279 | entry = q.popleft() |
| 280 | assert (is_addition, row) == ( |
| 281 | entry.insertion, |
| 282 | entry.row, |
| 283 | ), f"Got unexpected entry {key=} {row=} {time=} {is_addition=}, expected entries= {self.state!r}" |
| 284 | if not q: |
| 285 | self.state.pop(key) |
| 286 | |
| 287 | def on_end(self): |
| 288 | assert not self.state, f"Non empty final state = {self.state!r}" |
| 289 | |
| 290 | |
| 291 | # assert_key_entries_in_stream_consistent verifies for each key, whether: |
no outgoing calls
no test coverage detected