Jelajahi Sumber

Merge pull request #3652 from aanand/fix-tests-for-1.12

Fix tests to accommodate short-id container alias
Aanand Prasad 9 tahun lalu
induk
melakukan
55e20d1727
1 mengubah file dengan 8 tambahan dan 2 penghapusan
  1. 8 2
      tests/acceptance/cli_test.py

+ 8 - 2
tests/acceptance/cli_test.py

@@ -1135,7 +1135,10 @@ class CLITestCase(DockerClientTestCase):
             ]
 
             for _, config in networks.items():
-                assert not config['Aliases']
+                # TODO: once we drop support for API <1.24, this can be changed to:
+                # assert config['Aliases'] == [container.short_id]
+                aliases = set(config['Aliases']) - set([container.short_id])
+                assert not aliases
 
     @v2_only()
     def test_run_detached_connects_to_network(self):
@@ -1152,7 +1155,10 @@ class CLITestCase(DockerClientTestCase):
         ]
 
         for _, config in networks.items():
-            assert not config['Aliases']
+            # TODO: once we drop support for API <1.24, this can be changed to:
+            # assert config['Aliases'] == [container.short_id]
+            aliases = set(config['Aliases']) - set([container.short_id])
+            assert not aliases
 
         assert self.lookup(container, 'app')
         assert self.lookup(container, 'db')