From 4eccfd5396f7ceef14059a919b8f02521834f6a5 Mon Sep 17 00:00:00 2001 From: Imran Sobir Date: Thu, 9 Feb 2017 15:44:51 +0500 Subject: [PATCH] Style fixes. --- tests/unit/browser/test_qutescheme.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/unit/browser/test_qutescheme.py b/tests/unit/browser/test_qutescheme.py index 67c9a05f8..f97194415 100644 --- a/tests/unit/browser/test_qutescheme.py +++ b/tests/unit/browser/test_qutescheme.py @@ -17,20 +17,23 @@ # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see . +import datetime +import tempfile + from PyQt5.QtCore import QUrl +import pytest + from qutebrowser.browser import history, qutescheme from qutebrowser.utils import objreg -import datetime -import pytest -import tempfile class TestHistoryHandler: + """Test the qute://history endpoint.""" @pytest.fixture(autouse=True) def fake_objects(self, fake_save_manager): - """ Create fake web-history with history for three different days """ + """Create fake web-history with history for three different days.""" try: original_save_manager = objreg.get('save-manager') except KeyError: @@ -78,14 +81,14 @@ class TestHistoryHandler: objreg.delete('web-history') def test_history_without_query(self): - """ Test qute://history shows today's history when it has no query """ + """Ensure qute://history shows today's history when it has no query.""" _mimetype, data = qutescheme.qute_history(QUrl("qute://history")) key = "{}".format( datetime.date.today().strftime("%a, %d %B %Y")) assert key in data def test_history_with_bad_query(self): - """ Test qute://history shows today's history when given bad query """ + """Ensure qute://history shows today's history when given bad query.""" url = QUrl("qute://history?date=204-blaah") _mimetype, data = qutescheme.qute_history(url) key = "{}".format( @@ -93,7 +96,7 @@ class TestHistoryHandler: assert key in data def test_history_today(self): - """ Test qute://history shows history for today """ + """Ensure qute://history shows history for today.""" url = QUrl("qute://history") _mimetype, data = qutescheme.qute_history(url) assert "today" in data @@ -101,7 +104,7 @@ class TestHistoryHandler: assert "yesterday" not in data def test_history_yesterday(self): - """ Test qute://history shows history for yesterday """ + """Ensure qute://history shows history for yesterday.""" url = QUrl("qute://history?date=" + self.prev_date.strftime("%Y-%m-%d")) _mimetype, data = qutescheme.qute_history(url) assert "today" not in data @@ -109,7 +112,7 @@ class TestHistoryHandler: assert "yesterday" in data def test_history_tomorrow(self): - """ Test qute://history shows history for tomorrow """ + """Ensure qute://history shows history for tomorrow.""" url = QUrl("qute://history?date=" + self.next_date.strftime("%Y-%m-%d")) _mimetype, data = qutescheme.qute_history(url) assert "today" not in data