MCPcopy
hub / github.com/docker/docker-py / test_create_with_links

Method test_create_with_links

tests/integration/api_network_test.py:301–325  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

299
300 @requires_api_version('1.22')
301 def test_create_with_links(self):
302 net_name, net_id = self.create_network()
303
304 container = self.create_and_start(
305 host_config=self.client.create_host_config(network_mode=net_name),
306 networking_config=self.client.create_networking_config({
307 net_name: self.client.create_endpoint_config(
308 links=[('docker-py-test-upstream', 'bar')],
309 ),
310 }),
311 )
312
313 net_settings = self.client.inspect_container(container)[
314 'NetworkSettings'
315 ]
316 assert net_settings['Networks'][net_name]['Links'] == [
317 'docker-py-test-upstream:bar'
318 ]
319
320 self.create_and_start(
321 name='docker-py-test-upstream',
322 host_config=self.client.create_host_config(network_mode=net_name),
323 )
324
325 self.execute(container, ['nslookup', 'bar'])
326
327 def test_create_check_duplicate(self):
328 net_name, net_id = self.create_network()

Callers

nothing calls this directly

Calls 7

create_networkMethod · 0.95
create_host_configMethod · 0.80
inspect_containerMethod · 0.80
create_and_startMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected