From 569e7b11fb88c45ede7c55e3eb2afbcca46a7ff1 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 15 Mar 2016 07:19:43 +0100 Subject: [PATCH] Make test_elided_text work with non-unicode output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When Qt detects it can't output unicode (via the locale?), it elides using "..." instead of the unicode char "…". Now the test works in both scenarios. --- tests/unit/mainwindow/statusbar/test_textbase.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/mainwindow/statusbar/test_textbase.py b/tests/unit/mainwindow/statusbar/test_textbase.py index 24aa0773d..32058e259 100644 --- a/tests/unit/mainwindow/statusbar/test_textbase.py +++ b/tests/unit/mainwindow/statusbar/test_textbase.py @@ -26,10 +26,10 @@ from qutebrowser.mainwindow.statusbar.textbase import TextBase @pytest.mark.parametrize('elidemode, check', [ - (Qt.ElideRight, lambda s: s.endswith('…')), - (Qt.ElideLeft, lambda s: s.startswith('…')), - (Qt.ElideMiddle, lambda s: '…' in s), - (Qt.ElideNone, lambda s: '…' not in s), + (Qt.ElideRight, lambda s: s.endswith('…') or s.endswith('...')), + (Qt.ElideLeft, lambda s: s.startswith('…') or s.startswith('...')), + (Qt.ElideMiddle, lambda s: '…' in s or '...' in s), + (Qt.ElideNone, lambda s: '…' not in s and '...' not in s), ]) def test_elided_text(fake_statusbar, qtbot, elidemode, check): """Ensure that a widget too small to hold the entire label text will elide.