From 077dec332b995a5686bfc2bdfc67eefcc14813d3 Mon Sep 17 00:00:00 2001 From: mibe Date: Tue, 24 Oct 2023 12:02:51 +0100 Subject: [PATCH] Updated MockContext test_scroll test --- tests/test_mock_context.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/tests/test_mock_context.py b/tests/test_mock_context.py index 267c8f7..3a50bba 100644 --- a/tests/test_mock_context.py +++ b/tests/test_mock_context.py @@ -15,20 +15,13 @@ def context_set_emits(meta_set_emits): def test_scroll(context_set_emits): - assert not context_set_emits.output_groups - assert context_set_emits.next_group() - assert context_set_emits.t2 == 'cat' - assert context_set_emits.next() - assert context_set_emits.t2 == 'dog' - assert not context_set_emits.next() - assert context_set_emits.next_group() - assert context_set_emits.t2 == 'ant' - assert context_set_emits.next() - assert context_set_emits.t2 == 'bee' - assert context_set_emits.next() - assert context_set_emits.t2 == 'beetle' - assert not context_set_emits.next() - assert not context_set_emits.next_group() + groups = [] + while context_set_emits.next_group(): + group = [context_set_emits.t2] + while context_set_emits.next(): + group.append(context_set_emits.t2) + groups.append(group) + assert groups == [['cat', 'dog'], ['ant', 'bee', 'beetle']] def test_output_groups(context_set_emits):