#NEWLINE# def test_import( self ) : #NEWLINE# #INDENT# sender = CommandSubmitter ( 'test' , 'tester' ) #NEWLINE# short_test_channels = [ ( 'testch' + str ( x ) ) for x in range ( 3 ) ] #NEWLINE# long_test_channels = [ ( 'testch' + str ( x ) ) for x in range ( 10 ) ] #NEWLINE# self . service . setup ( self . parser ) #NEWLINE# self . service . start ( ) #NEWLINE# threading . Event ( ) . wait ( 1 ) #NEWLINE# self . service . stop ( ) #NEWLINE# self . service . _twitch . followed_ch_list = { #NEWLINE# #INDENT# 'some_twitch_user' : short_test_channels , #NEWLINE# #UNINDENT# } #NEWLINE# self . service . _import ( [ 'some_twitch_user' ] , sender ) #NEWLINE# self . service . _list_channel ( True , sender ) #NEWLINE# for ch in short_test_channels : #NEWLINE# #INDENT# ok_ ( ( ch . lower ( ) in ' ' . join ( interfaces . get ( 'test' ) . msg_queue [ sender ] ) . lower ( ) ) ) #NEWLINE# #UNINDENT# interfaces . get ( 'test' ) . reset ( ) #NEWLINE# self . service . _unsub_all ( True , sender ) #NEWLINE# self . service . _twitch . followed_ch_list = { #NEWLINE# #INDENT# 'some_twitch_user' : long_test_channels , #NEWLINE# #UNINDENT# } #NEWLINE# self . service . _import ( [ 'some_twitch_user' ] , sender ) #NEWLINE# self . service . _list_channel ( True , sender ) #NEWLINE# for ch in long_test_channels : #NEWLINE# #INDENT# ok_ ( ( ch . lower ( ) in ' ' . join ( interfaces . get ( 'test' ) . msg_queue [ sender ] ) . lower ( ) ) ) #NEWLINE# #UNINDENT# ok_ ( ( 'a while' in ' ' . join ( interfaces . get ( 'test' ) . msg_queue [ sender ] ) . lower ( ) ) ) #NEWLINE# interfaces . get ( 'test' ) . reset ( ) #NEWLINE# self . service . _unsub_all ( True , sender ) #NEWLINE# self . service . _twitch . followed_ch_list = { #NEWLINE# #INDENT# 'some_twitch_user' : long_test_channels , #NEWLINE# #UNINDENT# } #NEWLINE# self . service . _import ( [ 'some_twitch_user2' ] , sender ) #NEWLINE# self . service . _list_channel ( True , sender ) #NEWLINE# for ch in long_test_channels : #NEWLINE# #INDENT# ok_ ( ( ch . lower ( ) not in ' ' . join ( interfaces . get ( 'test' ) . msg_queue [ sender ] ) . lower ( ) ) ) #NEWLINE# #UNINDENT# ok_ ( ( 'not found' in ' ' . join ( interfaces . get ( 'test' ) . msg_queue [ sender ] ) . lower ( ) ) ) #NEWLINE# interfaces . get ( 'test' ) . reset ( ) #NEWLINE# self . service . _unsub_all ( True , sender )