Improved version comparisons throughout the codebase

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2017-07-06 17:25:41 -07:00 committed by Joffrey F
parent 6ff6528d45
commit 56a23bfcd2
13 changed files with 97 additions and 79 deletions

View file

@ -850,8 +850,13 @@ class CLITestCase(DockerClientTestCase):
# Two networks were created: back and front
assert sorted(n['Name'].split('/')[-1] for n in networks) == [back_name, front_name]
back_network = [n for n in networks if n['Name'] == back_name][0]
front_network = [n for n in networks if n['Name'] == front_name][0]
# lookup by ID instead of name in case of duplicates
back_network = self.client.inspect_network(
[n for n in networks if n['Name'] == back_name][0]['Id']
)
front_network = self.client.inspect_network(
[n for n in networks if n['Name'] == front_name][0]['Id']
)
web_container = self.project.get_service('web').containers()[0]
app_container = self.project.get_service('app').containers()[0]