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
This commit is contained in:
Takashi Kajinami 2021-09-05 00:56:38 +09:00
parent 2f047b1595
commit cff9c266c0

View File

@ -357,10 +357,10 @@ class ShellTest(testtools.TestCase):
self.useFixture(fixtures.MockPatchObject(openstack_shell, self.useFixture(fixtures.MockPatchObject(openstack_shell,
'COMMANDS', None)) 'COMMANDS', None))
openstack_shell.NeutronShell('2.0') openstack_shell.NeutronShell('2.0')
self.assertDictContainsSubset( self.assertLessEqual(
{'net-create': network.CreateNetwork, {'net-create': network.CreateNetwork,
'net-delete': network.DeleteNetwork, 'net-delete': network.DeleteNetwork,
'net-list': network.ListNetwork, 'net-list': network.ListNetwork,
'net-show': network.ShowNetwork, 'net-show': network.ShowNetwork,
'net-update': network.UpdateNetwork}, 'net-update': network.UpdateNetwork}.items(),
openstack_shell.COMMANDS['2.0']) openstack_shell.COMMANDS['2.0'].items())