From 9d6cd87202ef4dce182e8e3450578db81d9af2bf Mon Sep 17 00:00:00 2001 From: Denis Laxalde Date: Wed, 2 Jan 2019 13:17:02 +0100 Subject: [PATCH] Check full output in test_timeline We're going to update this test in the next commit and having complete output checked (including padding, column/row separations) will help. --- tests/test_console.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/test_console.py b/tests/test_console.py index 996cad6..41b6efe 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -136,12 +136,17 @@ def test_timeline(mock_get, monkeypatch, capsys): mock_get.assert_called_once_with(app, user, '/api/v1/timelines/home?limit=10', None) out, err = capsys.readouterr() - assert "The computer can't tell you the emotional story." in out - assert "but what's missing is the eyebrows." in out - assert "Frank Zappa" in out - assert "@fz" in out - assert "id: 111111111111111111" in out - assert "[RE]" not in out + + expected = ( + "───────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────\n" + "Frank Zappa │ The computer can't tell you the emotional story. It can give you the exact\n" + "@fz │ mathematical design, but what's missing is the eyebrows.\n" + "2017-04-12 15:53 │ \n" + "id: 111111111111111111 │ \n" + "───────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────\n" + ) + assert out == expected + assert err == "" @mock.patch('toot.http.get')