From efb31126b4d2bd44765afe002f5561168f3262c9 Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Sat, 28 Oct 2017 17:24:26 +0200 Subject: [PATCH] [tests] simplify assertion --- tests/io/test_csv.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/io/test_csv.py b/tests/io/test_csv.py index 9048bef..473d243 100644 --- a/tests/io/test_csv.py +++ b/tests/io/test_csv.py @@ -44,18 +44,18 @@ def test_read_csv_from_file_kwargs(tmpdir): CsvReader(path=filename, delimiter=','), services=services, ) as context: - context.write(BEGIN, Bag(), END) - context.step() - output = context.get_buffer() + context.write_sync(()) + + assert context.get_buffer() == [ + { + 'a': 'a foo', + 'b': 'b foo', + 'c': 'c foo', + }, + { + 'a': 'a bar', + 'b': 'b bar', + 'c': 'c bar', + } + ] - assert len(output) == 2 - assert output[0] == { - 'a': 'a foo', - 'b': 'b foo', - 'c': 'c foo', - } - assert output[1] == { - 'a': 'a bar', - 'b': 'b bar', - 'c': 'c bar', - }