From c659ed7a5d50834748e326f5d2f4a6534af260dd Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Thu, 30 Mar 2023 12:09:38 +0200 Subject: [PATCH] Fix tests --- tests/integration/test_status.py | 2 +- tests/test_console.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_status.py b/tests/integration/test_status.py index 8274174..b23f44e 100644 --- a/tests/integration/test_status.py +++ b/tests/integration/test_status.py @@ -46,7 +46,7 @@ def test_reblog(app, user, run): assert status["reblogged"] out = run("reblogged_by", status["id"]) - assert out == f"@{user.username}" + assert user.username in out out = run("unreblog", status["id"]) assert out == "✓ Status unreblogged" diff --git a/tests/test_console.py b/tests/test_console.py index 3b58d18..ffe1d12 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -177,7 +177,7 @@ def test_timeline_with_re(mock_get, monkeypatch, capsys): mock_get.assert_called_once_with(app, user, '/api/v1/timelines/home', {'limit': 10}) out, err = capsys.readouterr() - lines = out.split("\n") + lines = uncolorize(out).split("\n") assert "Frank Zappa" in lines[1] assert "@fz" in lines[1] @@ -349,6 +349,7 @@ def test_search(mock_get, capsys): }) out, err = capsys.readouterr() + out = uncolorize(out) assert "Hashtags:\n#foo, #bar, #baz" in out assert "Accounts:" in out assert "@thequeen Freddy Mercury" in out