@@ -248,6 +248,31 @@ def test_create_container_with_binds(self):
248
248
self .assertEqual (args [1 ]['headers' ],
249
249
{'Content-Type' : 'application/json' })
250
250
251
+ def test_create_container_with_volume_string (self ):
252
+ mount_dest = '/mnt'
253
+
254
+ try :
255
+ self .client .create_container ('busybox' , ['ls' , mount_dest ],
256
+ volumes = mount_dest )
257
+ except Exception as e :
258
+ self .fail ('Command should not raise exception: {0}' .format (e ))
259
+
260
+ args = fake_request .call_args
261
+ self .assertEqual (args [0 ][0 ],
262
+ url_prefix + 'containers/create' )
263
+ self .assertEqual (json .loads (args [1 ]['data' ]),
264
+ json .loads ('''
265
+ {"Tty": false, "Image": "busybox",
266
+ "Cmd": ["ls", "/mnt"], "AttachStdin": false,
267
+ "Volumes": {"/mnt": {}}, "Memory": 0,
268
+ "AttachStderr": true,
269
+ "AttachStdout": true, "OpenStdin": false,
270
+ "StdinOnce": false,
271
+ "NetworkDisabled": false,
272
+ "MemorySwap": 0}''' ))
273
+ self .assertEqual (args [1 ]['headers' ],
274
+ {'Content-Type' : 'application/json' })
275
+
251
276
def test_create_container_with_ports (self ):
252
277
try :
253
278
self .client .create_container ('busybox' , 'ls' ,
0 commit comments