Skip to content

Commit bb70d51

Browse files
committed
Add unit test.
1 parent 364fc4f commit bb70d51

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/unit/api_container_test.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,22 @@ def test_create_named_container(self):
346346
assert args[1]['headers'] == {'Content-Type': 'application/json'}
347347
assert args[1]['params'] == {'name': 'marisa-kirisame'}
348348

349+
def test_create_container_with_platform(self):
350+
self.client.create_container('busybox', 'true',
351+
platform='linux')
352+
353+
args = fake_request.call_args
354+
assert args[0][1] == url_prefix + 'containers/create'
355+
assert json.loads(args[1]['data']) == json.loads('''
356+
{"Tty": false, "Image": "busybox", "Cmd": ["true"],
357+
"AttachStdin": false,
358+
"AttachStderr": true, "AttachStdout": true,
359+
"StdinOnce": false,
360+
"OpenStdin": false, "NetworkDisabled": false}
361+
''')
362+
assert args[1]['headers'] == {'Content-Type': 'application/json'}
363+
assert args[1]['params'] == {'platform': 'linux'}
364+
349365
def test_create_container_with_mem_limit_as_int(self):
350366
self.client.create_container(
351367
'busybox', 'true', host_config=self.client.create_host_config(

0 commit comments

Comments
 (0)