#NEWLINE# def test_connectUnknownError( self ) : #NEWLINE# #INDENT# '\n        Unknown errors while connecting are logged, transition to idle state.\n        ' #NEWLINE# self . setUpState ( 'connecting' ) #NEWLINE# class UnknownError ( Exception ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# callCount = 1 #NEWLINE# for delay in ( 10 , 20 , 40 , 80 , 160 , 240 , 240 ) : #NEWLINE# #INDENT# self . api . connectFail ( UnknownError ( ) ) #NEWLINE# self . clock . advance ( 0 ) #NEWLINE# self . assertEquals ( 1 , len ( self . flushLoggedErrors ( UnknownError ) ) ) #NEWLINE# self . clock . advance ( delay ) #NEWLINE# callCount += 1 #NEWLINE# self . assertEqual ( callCount , len ( self . api . filterCalls ) )