From c24c4669a48d94d7843310f9f8a5c5d6cdca5e71 Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Wed, 9 Dec 2015 01:41:37 -0800 Subject: [PATCH] Fixed tests. --- rtv/terminal.py | 3 ++- tests/test_submission.py | 2 +- tests/test_subreddit.py | 2 +- tests/test_subscription.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rtv/terminal.py b/rtv/terminal.py index 6fb0fae..7094f20 100644 --- a/rtv/terminal.py +++ b/rtv/terminal.py @@ -194,7 +194,8 @@ class Terminal(object): if n_cols is not None and n_cols <= 0: return '' - string = unescape(string) + if isinstance(string, six.text_type): + string = unescape(string) if self.ascii: if isinstance(string, six.binary_type): diff --git a/tests/test_submission.py b/tests/test_submission.py index 5dab8e3..afc8fed 100644 --- a/tests/test_submission.py +++ b/tests/test_submission.py @@ -31,7 +31,7 @@ def test_submission_page_construct(reddit, terminal, config, oauth): # Banner menu = ('[1]hot ' '[2]top ' - '[3]rising ' + '[3]rising ' '[4]new ' '[5]controversial').encode('utf-8') window.addstr.assert_any_call(0, 0, menu) diff --git a/tests/test_subreddit.py b/tests/test_subreddit.py index 26a1e71..81b7730 100644 --- a/tests/test_subreddit.py +++ b/tests/test_subreddit.py @@ -24,7 +24,7 @@ def test_subreddit_page_construct(reddit, terminal, config, oauth): # Banner menu = ('[1]hot ' '[2]top ' - '[3]rising ' + '[3]rising ' '[4]new ' '[5]controversial').encode('utf-8') window.addstr.assert_any_call(0, 0, menu) diff --git a/tests/test_subscription.py b/tests/test_subscription.py index c54265e..a3ccb2b 100644 --- a/tests/test_subscription.py +++ b/tests/test_subscription.py @@ -45,7 +45,7 @@ def test_subscription_page_construct(reddit, terminal, config, oauth, # Banner shouldn't be drawn menu = ('[1]hot ' '[2]top ' - '[3]rising ' + '[3]rising ' '[4]new ' '[5]controversial').encode('utf-8') with pytest.raises(AssertionError):