#NEWLINE# @ skipIf ( ( _docker_py_version ( ) < ( 1 , 4 , 0 ) ) , 'docker module must be installed to run this test or is too old. >=1.4.0' ) #NEWLINE# @ patch . object ( dockerng_mod , 'images' , MagicMock ( ) ) #NEWLINE# @ patch . object ( dockerng_mod , 'inspect_image' ) #NEWLINE# @ patch . object ( dockerng_mod , 'version' , Mock ( return_value = { #NEWLINE# #INDENT# 'ApiVersion' : '1.19' , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# def test_create_with_arg_cmd( self , * args ) : #NEWLINE# #INDENT# '\n        When cmd argument is passed check it is renamed to command.\n        ' #NEWLINE# __salt__ = { #NEWLINE# #INDENT# 'config.get' : Mock ( ) , #NEWLINE# 'mine.send' : Mock ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# host_config = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# client = Mock ( ) #NEWLINE# client . api_version = '1.19' #NEWLINE# client . create_host_config . return_value = host_config #NEWLINE# client . create_container . return_value = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# with patch . dict ( dockerng_mod . __dict__ , { #NEWLINE# #INDENT# '__salt__' : __salt__ , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# with patch . dict ( dockerng_mod . __context__ , { #NEWLINE# #INDENT# 'docker.client' : client , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# dockerng_mod . create ( 'image' , cmd = 'ls' , name = 'ctn' ) #NEWLINE# #UNINDENT# #UNINDENT# client . create_container . assert_called_once_with ( command = 'ls' , host_config = self , image = 'image' , name = 'ctn' )