#NEWLINE# def testExitCancelsEntry( self ) : #NEWLINE# #INDENT# strat = self . createStrategy ( ) #NEWLINE# strat . addPosEntry ( datetime . datetime ( 2000 , 11 , 10 ) , strat . enterLongLimit , BaseTestCase . TestInstrument , 5 , 1 , True ) #NEWLINE# strat . addPosExitLimit ( datetime . datetime ( 2000 , 11 , 14 ) , 100 ) #NEWLINE# strat . run ( ) #NEWLINE# self . assertEqual ( strat . enterOkCalls , 0 ) #NEWLINE# self . assertEqual ( strat . enterCanceledCalls , 1 ) #NEWLINE# self . assertEqual ( self . exitOkCalls , 0 ) #NEWLINE# self . assertTrue ( ( strat . exitCanceledCalls == 0 ) ) #NEWLINE# self . assertTrue ( ( round ( strat . getBroker ( ) . getCash ( ) , 2 ) == 1000 ) )