Kaydet (Commit) 110c6769 authored tarafından Hannes Ljungberg's avatar Hannes Ljungberg

Add test for join on already joined swarm

Signed-off-by: 's avatarHannes Ljungberg <hannes@5monkeys.se>
üst c7b9cae0
......@@ -31,3 +31,15 @@ class SwarmTest(unittest.TestCase):
cm.value.response.status_code == 406 or
cm.value.response.status_code == 503
)
def test_join_on_already_joined_swarm(self):
client = docker.from_env(version=TEST_API_VERSION)
client.swarm.init()
join_token = client.swarm.attrs['JoinTokens']['Manager']
with pytest.raises(docker.errors.APIError) as cm:
client.swarm.join(
remote_addrs=['127.0.0.1'],
join_token=join_token,
)
assert cm.value.response.status_code == 503
assert 'This node is already part of a swarm.' in cm.value.explanation
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment