#NEWLINE# @ unittest . skipIf ( ( mock is None ) , 'mock package not present' ) #NEWLINE# def test_on_kill( self ) : #NEWLINE# #INDENT# client_mock = mock . Mock ( spec = Client ) #NEWLINE# operator = DockerOperator ( image = 'ubuntu' , owner = 'unittest' , task_id = 'unittest' ) #NEWLINE# operator . cli = client_mock #NEWLINE# operator . container = { #NEWLINE# #INDENT# 'Id' : 'some_id' , #NEWLINE# #UNINDENT# } #NEWLINE# operator . on_kill ( ) #NEWLINE# client_mock . stop . assert_called_with ( 'some_id' )