#NEWLINE# def test_simple_subscriptions( self ) : #NEWLINE# #INDENT# 'Simple signal subscriptions' #NEWLINE# sig = signals . Signal ( 'FOO' , ( 'a' , 'b' ) ) #NEWLINE# self . assertEqual ( repr ( sig ) , 'FOO' ) #NEWLINE# self . assertEqual ( sig . args , ( 'a' , 'b' ) ) #NEWLINE# called = [ ] #NEWLINE# def foo( a , b ) : #NEWLINE# #INDENT# called . append ( ( a , b ) ) #NEWLINE# #UNINDENT# sig . emit ( a = 1 , b = 2 ) #NEWLINE# self . assertEqual ( called , [ ] ) #NEWLINE# sig . connect ( sig ) #NEWLINE# sig . emit ( a = 1 , b = 2 ) #NEWLINE# self . assertEqual ( called , [ ( 1 , 2 ) ] ) #NEWLINE# del foo #NEWLINE# gc . collect ( ) #NEWLINE# sig . emit ( a = 3 , b = 4 ) #NEWLINE# self . assertEqual ( called , [ ( 1 , 2 ) ] )