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

Method test_inspect_network

tests/unit/api_network_test.py:103–121  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

101 assert args[0][0] == f"{url_prefix}networks/{network_id}"
102
103 def test_inspect_network(self):
104 network_id = 'abc12345'
105 network_name = 'foo'
106 network_data = {
107 'name': network_name,
108 'id': network_id,
109 'driver': 'bridge',
110 'containers': {},
111 }
112
113 network_response = response(status_code=200, content=network_data)
114 get = mock.Mock(return_value=network_response)
115
116 with mock.patch('docker.api.client.APIClient.get', get):
117 result = self.client.inspect_network(network_id)
118 assert result == network_data
119
120 args = get.call_args
121 assert args[0][0] == f"{url_prefix}networks/{network_id}"
122
123 def test_connect_container_to_network(self):
124 network_id = 'abc12345'

Callers

nothing calls this directly

Calls 2

responseFunction · 0.85
inspect_networkMethod · 0.80

Tested by

no test coverage detected