From 1dc4c52b65232a2cd935112a507a9b4ccc603cb5 Mon Sep 17 00:00:00 2001 From: Sam Tebbs Date: Thu, 9 Aug 2018 15:59:30 +0100 Subject: [PATCH 1/3] Adds refresh to footer --- rtv/docs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtv/docs.py b/rtv/docs.py index 4c776fb..8238731 100644 --- a/rtv/docs.py +++ b/rtv/docs.py @@ -103,11 +103,11 @@ BANNER_SEARCH = """ """ FOOTER_SUBREDDIT = """ -[?]Help [q]Quit [l]Comments [/]Prompt [u]Login [o]Open [c]Post [a/z]Vote +[?]Help [q]Quit [l]Comments [/]Prompt [u]Login [o]Open [c]Post [a/z]Vote [r]Refresh """ FOOTER_SUBMISSION = """ -[?]Help [q]Quit [h]Return [space]Fold/Expand [o]Open [c]Comment [a/z]Vote +[?]Help [q]Quit [h]Return [space]Fold/Expand [o]Open [c]Comment [a/z]Vote [r]Refresh """ FOOTER_SUBSCRIPTION = """ From 4479478492e95059663a5f15fa76fa5e1b6ae99a Mon Sep 17 00:00:00 2001 From: Sam Tebbs Date: Thu, 9 Aug 2018 21:22:21 +0100 Subject: [PATCH 2/3] Added refresh to footer in test --- tests/test_submission.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_submission.py b/tests/test_submission.py index 833681c..631b832 100644 --- a/tests/test_submission.py +++ b/tests/test_submission.py @@ -67,7 +67,7 @@ def test_submission_page_construct(reddit, terminal, config, oauth): # Footer text = ('[?]Help [q]Quit [h]Return [space]Fold/Expand [o]Open [c]Comment ' - '[a/z]Vote'.encode('utf-8')) + '[a/z]Vote [r]Refresh'.encode('utf-8')) window.addstr.assert_any_call(0, 0, text) # Submission From 61853da8e8508fb1a0852869f69fd7f7429fffa7 Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Sun, 12 Aug 2018 21:53:05 -0400 Subject: [PATCH 3/3] Fixing test --- tests/test_submission.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/test_submission.py b/tests/test_submission.py index 631b832..a8a8a0e 100644 --- a/tests/test_submission.py +++ b/tests/test_submission.py @@ -9,6 +9,7 @@ from collections import OrderedDict import pytest from rtv.submission_page import SubmissionPage +from rtv.docs import FOOTER_SUBMISSION try: from unittest import mock @@ -58,17 +59,12 @@ def test_submission_page_construct(reddit, terminal, config, oauth): window.addstr.assert_any_call(0, 0, title) # Banner - menu = ('[1]hot ' - '[2]top ' - '[3]rising ' - '[4]new ' - '[5]controversial').encode('utf-8') - window.addstr.assert_any_call(0, 0, menu) + menu = '[1]hot [2]top [3]rising [4]new [5]controversial' + window.addstr.assert_any_call(0, 0, menu.encode('utf-8')) - # Footer - text = ('[?]Help [q]Quit [h]Return [space]Fold/Expand [o]Open [c]Comment ' - '[a/z]Vote [r]Refresh'.encode('utf-8')) - window.addstr.assert_any_call(0, 0, text) + # Footer - The text is longer than the default terminal width + text = FOOTER_SUBMISSION.strip()[:79] + window.addstr.assert_any_call(0, 0, text.encode('utf-8')) # Submission submission_data = page.content.get(-1)