From cff9c266c05ebfc13f4917e1646e5dedbe371cc2 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 5 Sep 2021 00:56:38 +0900 Subject: [PATCH] Replace deprecated assertDictContainsSubset The method is deprecated since Python 3.2[1] and shows the following DeprecationWarning. /usr/lib/python3.9/unittest/case.py:1134: DeprecationWarning: assertDictContainsSubset is deprecated warnings.warn('assertDictContainsSubset is deprecated', [1] https://docs.python.org/3/whatsnew/3.2.html#unittest Closes-Bug: #1938103 Change-Id: I1d0ee6c77476707a7e4fe4fbf2b979bf34550d05 --- neutronclient/tests/unit/test_shell.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neutronclient/tests/unit/test_shell.py b/neutronclient/tests/unit/test_shell.py index 9dc2faac8..04e814066 100644 --- a/neutronclient/tests/unit/test_shell.py +++ b/neutronclient/tests/unit/test_shell.py @@ -357,10 +357,10 @@ class ShellTest(testtools.TestCase): self.useFixture(fixtures.MockPatchObject(openstack_shell, 'COMMANDS', None)) openstack_shell.NeutronShell('2.0') - self.assertDictContainsSubset( + self.assertLessEqual( {'net-create': network.CreateNetwork, 'net-delete': network.DeleteNetwork, 'net-list': network.ListNetwork, 'net-show': network.ShowNetwork, - 'net-update': network.UpdateNetwork}, - openstack_shell.COMMANDS['2.0']) + 'net-update': network.UpdateNetwork}.items(), + openstack_shell.COMMANDS['2.0'].items())