MCPcopy Index your code
hub / github.com/docker/docker-py / test_exec_command_as_user

Method test_exec_command_as_user

tests/integration/api_exec_test.py:77–88  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

75 assert exec_log == b'hello world\n'
76
77 def test_exec_command_as_user(self):
78 container = self.client.create_container(TEST_IMG, 'cat',
79 detach=True, stdin_open=True)
80 id = container['Id']
81 self.client.start(id)
82 self.tmp_containers.append(id)
83
84 res = self.client.exec_create(id, 'whoami', user='postgres')
85 assert 'Id' in res
86
87 exec_log = self.client.exec_start(res)
88 assert exec_log == b'postgres\n'
89
90 def test_exec_command_as_root(self):
91 container = self.client.create_container(TEST_IMG, 'cat',

Callers

nothing calls this directly

Calls 4

create_containerMethod · 0.80
exec_createMethod · 0.80
exec_startMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected