Added unit tests for banner.

This commit is contained in:
Michael Lazar
2015-12-09 01:34:55 -08:00
parent 9de6056b04
commit 329bfae1ec
3 changed files with 26 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ from __future__ import unicode_literals
import curses
import praw
import pytest
from rtv.subscription import SubscriptionPage
@@ -41,6 +42,15 @@ def test_subscription_page_construct(reddit, terminal, config, oauth,
name = reddit.user.name.encode('utf-8')
window.addstr.assert_any_call(0, 59, name)
# Banner shouldn't be drawn
menu = ('[1]hot '
'[2]top '
'[3]rising '
'[4]new '
'[5]controversial').encode('utf-8')
with pytest.raises(AssertionError):
window.addstr.assert_any_call(0, 0, menu)
# Cursor - 2 lines
window.subwin.chgat.assert_any_call(0, 0, 1, 262144)
window.subwin.chgat.assert_any_call(1, 0, 1, 262144)