#NEWLINE# def test_subscription_page_construct( reddit , terminal , config , oauth , refresh_token ) : #NEWLINE# #INDENT# window = terminal . stdscr . subwin #NEWLINE# with terminal . loader ( ) : #NEWLINE# #INDENT# SubscriptionPage ( reddit , terminal , config , oauth ) #NEWLINE# #UNINDENT# assert isinstance ( terminal . loader . exception , praw . errors . LoginOrScopeRequired ) #NEWLINE# config . refresh_token = refresh_token #NEWLINE# oauth . authorize ( ) #NEWLINE# with terminal . loader ( ) : #NEWLINE# #INDENT# page = SubscriptionPage ( reddit , terminal , config , oauth ) #NEWLINE# #UNINDENT# assert ( terminal . loader . exception is None ) #NEWLINE# page . draw ( ) #NEWLINE# title = 'Subscriptions' . encode ( 'utf-8' ) #NEWLINE# window . addstr . assert_any_call ( 0 , 0 , title ) #NEWLINE# name = reddit . user . name . encode ( 'utf-8' ) #NEWLINE# window . addstr . assert_any_call ( 0 , 59 , name ) #NEWLINE# menu = '[1]hot         [2]top         [3]rising         [4]new         [5]controversial' . encode ( 'utf-8' ) #NEWLINE# with pytest . raises ( AssertionError ) : #NEWLINE# #INDENT# window . addstr . assert_any_call ( 0 , 0 , title ) #NEWLINE# #UNINDENT# window . subwin . chgat . assert_any_call ( 0 , 0 , 1 , 262144 ) #NEWLINE# window . subwin . chgat . assert_any_call ( 1 , 0 , 1 , 262144 ) #NEWLINE# terminal . stdscr . ncols = 20 #NEWLINE# terminal . stdscr . nlines = 10 #NEWLINE# with terminal . loader ( ) : #NEWLINE# #INDENT# page = SubscriptionPage ( reddit , terminal , config , oauth ) #NEWLINE# #UNINDENT# assert ( terminal . loader . exception is None ) #NEWLINE# page . draw ( )