MCPcopy
hub / github.com/faust-streaming/faust / test__modify_set

Method test__modify_set

tests/unit/tables/test_sets.py:308–423  ·  view source on GitHub ↗
(self, *, man)

Source from the content-addressed store, hash-verified

306 @pytest.mark.asyncio
307 @pytest.mark.allow_lingering_tasks(count=1)
308 async def test__modify_set(self, *, man):
309 stream = Mock()
310 man.set_table = {
311 "k1": Mock(name="k1"),
312 "k2": Mock(name="k2"),
313 "k3": Mock(name="k3"),
314 "k4": Mock(name="k4"),
315 "k5": Mock(name="k5"),
316 "k6": Mock(name="k6"),
317 "k7": Mock(name="k7"),
318 "k8": Mock(name="k8"),
319 }
320
321 class X(faust.Record):
322 x: int
323 y: int
324
325 unknown_set_op = SetManagerOperation(
326 action=SetAction.ADD,
327 members=["v4"],
328 )
329 unknown_set_op.action = "UNKNOWN"
330
331 async def stream_items():
332 yield (
333 "k1",
334 SetManagerOperation(
335 action=SetAction.ADD,
336 members=["v"],
337 ),
338 )
339 yield (
340 "k2",
341 SetManagerOperation(
342 action=SetAction.DISCARD,
343 members=["v2"],
344 ),
345 )
346 yield (
347 "k3",
348 SetManagerOperation(
349 action=SetAction.DISCARD,
350 members=[X(10, 30).to_representation()],
351 ),
352 )
353 yield ("k4", unknown_set_op)
354 yield (
355 "k5",
356 SetManagerOperation(
357 action=SetAction.ADD,
358 members=[
359 X(10, 30).to_representation(),
360 X(20, 40).to_representation(),
361 "v3",
362 ],
363 ),
364 )
365 yield (

Callers

nothing calls this directly

Calls 4

SetManagerOperationClass · 0.90
MockClass · 0.85
_modify_setMethod · 0.80
XClass · 0.70

Tested by

no test coverage detected