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

Method test_join_swarm

tests/unit/swarm_test.py:29–50  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

27
28 @requires_api_version('1.24')
29 def test_join_swarm(self):
30 remote_addr = ['1.2.3.4:2377']
31 listen_addr = '2.3.4.5:2377'
32 join_token = 'A_BEAUTIFUL_JOIN_TOKEN'
33
34 data = {
35 'RemoteAddrs': remote_addr,
36 'ListenAddr': listen_addr,
37 'JoinToken': join_token
38 }
39
40 self.client.join_swarm(
41 remote_addrs=remote_addr,
42 listen_addr=listen_addr,
43 join_token=join_token
44 )
45
46 args = fake_request.call_args
47
48 assert (args[0][1] == f"{url_prefix}swarm/join")
49 assert (json.loads(args[1]['data']) == data)
50 assert (args[1]['headers']['Content-Type'] == 'application/json')
51
52 @requires_api_version('1.24')
53 def test_join_swarm_no_listen_address_takes_default(self):

Callers

nothing calls this directly

Calls 1

join_swarmMethod · 0.80

Tested by

no test coverage detected