From 93868fc6b50c782c8026b2c8907346e25470727f Mon Sep 17 00:00:00 2001
From: YAMAMOTO Takashi <yamamoto@midokura.com>
Date: Wed, 26 Jul 2017 19:58:07 +0900
Subject: [PATCH] Update neutron cli unit tests

After the recent python-neutronclient change. [1]

[1] I3950ed8cf50508210c8b3270724e283aea8e1673

Closed-Bug: #1706573
Change-Id: I8bf78427812895000a85466fb15f0ca65331dff6
---
 neutron_taas/tests/unit/taas_client/test_cli20_tapflow.py   | 6 ++++--
 .../tests/unit/taas_client/test_cli20_tapservice.py         | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/neutron_taas/tests/unit/taas_client/test_cli20_tapflow.py b/neutron_taas/tests/unit/taas_client/test_cli20_tapflow.py
index 50e366ad..9e603f91 100644
--- a/neutron_taas/tests/unit/taas_client/test_cli20_tapflow.py
+++ b/neutron_taas/tests/unit/taas_client/test_cli20_tapflow.py
@@ -43,12 +43,14 @@ class CLITestV20TapFlowJSON(test_cli20.CLITestV20Base):
         return contrib
 
     def test_ext_cmd_loaded(self):
-        shell.NeutronShell('2.0')
+        neutron_shell = shell.NeutronShell('2.0')
         extension_cmd = {'tap-flow-create': tapflow.CreateTapFlow,
                          'tap-flow-delete': tapflow.DeleteTapFlow,
                          'tap-flow-show': tapflow.ShowTapFlow,
                          'tap-flow-list': tapflow.ListTapFlow}
-        self.assertDictContainsSubset(extension_cmd, shell.COMMANDS['2.0'])
+        for cmd_name, cmd_class in extension_cmd.items():
+            found = neutron_shell.command_manager.find_command([cmd_name])
+            self.assertEqual(cmd_class, found[0])
 
     def _test_create_tap_flow(self, port_id="random_port",
                               service_id="random_service",
diff --git a/neutron_taas/tests/unit/taas_client/test_cli20_tapservice.py b/neutron_taas/tests/unit/taas_client/test_cli20_tapservice.py
index b6428ba0..f2cac09a 100644
--- a/neutron_taas/tests/unit/taas_client/test_cli20_tapservice.py
+++ b/neutron_taas/tests/unit/taas_client/test_cli20_tapservice.py
@@ -43,12 +43,14 @@ class CLITestV20TapServiceJSON(test_cli20.CLITestV20Base):
         return contrib
 
     def test_ext_cmd_loaded(self):
-        shell.NeutronShell('2.0')
+        neutron_shell = shell.NeutronShell('2.0')
         extension_cmd = {'tap-service-create': tapservice.CreateTapService,
                          'tap-service-delete': tapservice.DeleteTapService,
                          'tap-service-show': tapservice.ShowTapService,
                          'tap-service-list': tapservice.ListTapService}
-        self.assertDictContainsSubset(extension_cmd, shell.COMMANDS['2.0'])
+        for cmd_name, cmd_class in extension_cmd.items():
+            found = neutron_shell.command_manager.find_command([cmd_name])
+            self.assertEqual(cmd_class, found[0])
 
     def _test_create_tap_service(self, port_id="random_port",
                                  name='',