Merge "tests: Remove use of unnecessary fake argparse Namespace"

This commit is contained in:
Zuul 2024-04-12 17:28:37 +00:00 committed by Gerrit Code Review
commit 9db8902c2b
35 changed files with 183 additions and 270 deletions

View File

@ -513,7 +513,7 @@ class TestServerAddFloatingIPNetwork(
self.network_client.update_ip = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = server.AddFloatingIP(self.app, self.namespace)
self.cmd = server.AddFloatingIP(self.app, None)
def test_server_add_floating_ip(self):
_server = compute_fakes.create_one_server()
@ -7182,7 +7182,7 @@ class TestServerRemoveFloatingIPNetwork(network_fakes.TestNetworkV2):
self.network_client.update_ip = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = server.RemoveFloatingIP(self.app, self.namespace)
self.cmd = server.RemoveFloatingIP(self.app, None)
def test_server_remove_floating_ip_default(self):
_server = compute_fakes.create_one_server()

View File

@ -11,7 +11,6 @@
# under the License.
#
import argparse
from unittest import mock
import openstack
@ -126,8 +125,6 @@ class TestNetworkAndCompute(utils.TestCommand):
def setUp(self):
super().setUp()
self.namespace = argparse.Namespace()
# Create client mocks. Note that we intentionally do not use specced
# mocks since we want to test fake methods.
@ -143,7 +140,7 @@ class TestNetworkAndCompute(utils.TestCommand):
return_value='take_action_compute'
)
self.cmd = FakeNetworkAndComputeCommand(self.app, self.namespace)
self.cmd = FakeNetworkAndComputeCommand(self.app, None)
def test_take_action_network(self):
arglist = ['common', 'network']
@ -168,19 +165,19 @@ class TestNetworkAndCompute(utils.TestCommand):
class TestNetworkAndComputeCommand(TestNetworkAndCompute):
def setUp(self):
super(TestNetworkAndComputeCommand, self).setUp()
self.cmd = FakeNetworkAndComputeCommand(self.app, self.namespace)
self.cmd = FakeNetworkAndComputeCommand(self.app, None)
class TestNetworkAndComputeLister(TestNetworkAndCompute):
def setUp(self):
super(TestNetworkAndComputeLister, self).setUp()
self.cmd = FakeNetworkAndComputeLister(self.app, self.namespace)
self.cmd = FakeNetworkAndComputeLister(self.app, None)
class TestNetworkAndComputeShowOne(TestNetworkAndCompute):
def setUp(self):
super(TestNetworkAndComputeShowOne, self).setUp()
self.cmd = FakeNetworkAndComputeShowOne(self.app, self.namespace)
self.cmd = FakeNetworkAndComputeShowOne(self.app, None)
def test_take_action_with_http_exception(self):
with mock.patch.object(self.cmd, 'take_action_network') as m_action:
@ -207,8 +204,6 @@ class TestNeutronCommandWithExtraArgs(utils.TestCommand):
def setUp(self):
super(TestNeutronCommandWithExtraArgs, self).setUp()
self.namespace = argparse.Namespace()
# Create client mocks. Note that we intentionally do not use specced
# mocks since we want to test fake methods.
@ -217,9 +212,7 @@ class TestNeutronCommandWithExtraArgs(utils.TestCommand):
self.network_client.test_create_action = mock.Mock()
# Subclasses can override the command object to test.
self.cmd = FakeCreateNeutronCommandWithExtraArgs(
self.app, self.namespace
)
self.cmd = FakeCreateNeutronCommandWithExtraArgs(self.app, None)
def test_create_extra_attributes_default_type(self):
arglist = [

View File

@ -10,7 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import argparse
import copy
from random import choice
from random import randint
@ -106,10 +105,7 @@ class TestNetworkV2(
FakeClientMixin,
utils.TestCommand,
):
def setUp(self):
super().setUp()
self.namespace = argparse.Namespace()
...
def create_one_extension(attrs=None):

View File

@ -63,7 +63,7 @@ class TestCreateAddressGroup(TestAddressGroup):
)
# Get the command object to test
self.cmd = address_group.CreateAddressGroup(self.app, self.namespace)
self.cmd = address_group.CreateAddressGroup(self.app, None)
self.projects_mock.get.return_value = self.project
self.domains_mock.get.return_value = self.domain
@ -153,7 +153,7 @@ class TestDeleteAddressGroup(TestAddressGroup):
)
# Get the command object to test
self.cmd = address_group.DeleteAddressGroup(self.app, self.namespace)
self.cmd = address_group.DeleteAddressGroup(self.app, None)
def test_address_group_delete(self):
arglist = [
@ -256,7 +256,7 @@ class TestListAddressGroup(TestAddressGroup):
)
# Get the command object to test
self.cmd = address_group.ListAddressGroup(self.app, self.namespace)
self.cmd = address_group.ListAddressGroup(self.app, None)
def test_address_group_list(self):
arglist = []
@ -341,7 +341,7 @@ class TestSetAddressGroup(TestAddressGroup):
return_value=self._address_group
)
# Get the command object to test
self.cmd = address_group.SetAddressGroup(self.app, self.namespace)
self.cmd = address_group.SetAddressGroup(self.app, None)
def test_set_nothing(self):
arglist = [
@ -447,7 +447,7 @@ class TestShowAddressGroup(TestAddressGroup):
)
# Get the command object to test
self.cmd = address_group.ShowAddressGroup(self.app, self.namespace)
self.cmd = address_group.ShowAddressGroup(self.app, None)
def test_show_no_options(self):
arglist = []
@ -493,7 +493,7 @@ class TestUnsetAddressGroup(TestAddressGroup):
return_value=self._address_group
)
# Get the command object to test
self.cmd = address_group.UnsetAddressGroup(self.app, self.namespace)
self.cmd = address_group.UnsetAddressGroup(self.app, None)
def test_unset_nothing(self):
arglist = [

View File

@ -57,7 +57,7 @@ class TestCreateAddressScope(TestAddressScope):
)
# Get the command object to test
self.cmd = address_scope.CreateAddressScope(self.app, self.namespace)
self.cmd = address_scope.CreateAddressScope(self.app, None)
self.projects_mock.get.return_value = self.project
self.domains_mock.get.return_value = self.domain
@ -168,7 +168,7 @@ class TestDeleteAddressScope(TestAddressScope):
)
# Get the command object to test
self.cmd = address_scope.DeleteAddressScope(self.app, self.namespace)
self.cmd = address_scope.DeleteAddressScope(self.app, None)
def test_address_scope_delete(self):
arglist = [
@ -272,7 +272,7 @@ class TestListAddressScope(TestAddressScope):
)
# Get the command object to test
self.cmd = address_scope.ListAddressScope(self.app, self.namespace)
self.cmd = address_scope.ListAddressScope(self.app, None)
def test_address_scope_list(self):
arglist = []
@ -404,7 +404,7 @@ class TestSetAddressScope(TestAddressScope):
)
# Get the command object to test
self.cmd = address_scope.SetAddressScope(self.app, self.namespace)
self.cmd = address_scope.SetAddressScope(self.app, None)
def test_set_nothing(self):
arglist = [
@ -493,7 +493,7 @@ class TestShowAddressScope(TestAddressScope):
)
# Get the command object to test
self.cmd = address_scope.ShowAddressScope(self.app, self.namespace)
self.cmd = address_scope.ShowAddressScope(self.app, None)
def test_show_no_options(self):
arglist = []

View File

@ -105,7 +105,7 @@ class TestCreateDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
# Get the command object to test
self.cmd = default_security_group_rule.CreateDefaultSecurityGroupRule(
self.app, self.namespace
self.app, None
)
def test_create_all_remote_options(self):
@ -848,7 +848,7 @@ class TestDeleteDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
# Get the command object to test
self.cmd = default_security_group_rule.DeleteDefaultSecurityGroupRule(
self.app, self.namespace
self.app, None
)
def test_default_security_group_rule_delete(self):
@ -985,7 +985,7 @@ class TestListDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
# Get the command object to test
self.cmd = default_security_group_rule.ListDefaultSecurityGroupRule(
self.app, self.namespace
self.app, None
)
def test_list_default(self):
@ -1107,7 +1107,7 @@ class TestShowDefaultSecurityGroupRule(TestDefaultSecurityGroupRule):
# Get the command object to test
self.cmd = default_security_group_rule.ShowDefaultSecurityGroupRule(
self.app, self.namespace
self.app, None
)
def test_show_no_options(self):

View File

@ -95,7 +95,7 @@ class TestCreateFloatingIPNetwork(TestFloatingIPNetwork):
self.network_client.find_port = mock.Mock(return_value=self.port)
# Get the command object to test
self.cmd = fip.CreateFloatingIP(self.app, self.namespace)
self.cmd = fip.CreateFloatingIP(self.app, None)
def test_create_no_options(self):
arglist = []
@ -306,7 +306,7 @@ class TestDeleteFloatingIPNetwork(TestFloatingIPNetwork):
self.network_client.delete_ip = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = fip.DeleteFloatingIP(self.app, self.namespace)
self.cmd = fip.DeleteFloatingIP(self.app, None)
def test_floating_ip_delete(self):
self.network_client.find_ip.side_effect = [
@ -479,7 +479,7 @@ class TestListFloatingIPNetwork(TestFloatingIPNetwork):
)
# Get the command object to test
self.cmd = fip.ListFloatingIP(self.app, self.namespace)
self.cmd = fip.ListFloatingIP(self.app, None)
def test_floating_ip_list(self):
arglist = []
@ -747,7 +747,7 @@ class TestShowFloatingIPNetwork(TestFloatingIPNetwork):
self.network_client.find_ip = mock.Mock(return_value=self.floating_ip)
# Get the command object to test
self.cmd = fip.ShowFloatingIP(self.app, self.namespace)
self.cmd = fip.ShowFloatingIP(self.app, None)
def test_floating_ip_show(self):
arglist = [
@ -791,7 +791,7 @@ class TestSetFloatingIP(TestFloatingIPNetwork):
self.network_client.set_tags = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = fip.SetFloatingIP(self.app, self.namespace)
self.cmd = fip.SetFloatingIP(self.app, None)
def test_port_option(self):
arglist = [
@ -1041,7 +1041,7 @@ class TestUnsetFloatingIP(TestFloatingIPNetwork):
self.network_client.set_tags = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = fip.UnsetFloatingIP(self.app, self.namespace)
self.cmd = fip.UnsetFloatingIP(self.app, None)
def test_floating_ip_unset_port(self):
arglist = [

View File

@ -27,9 +27,7 @@ class TestListFloatingIPPoolNetwork(TestFloatingIPPoolNetwork):
super(TestListFloatingIPPoolNetwork, self).setUp()
# Get the command object to test
self.cmd = floating_ip_pool.ListFloatingIPPool(
self.app, self.namespace
)
self.cmd = floating_ip_pool.ListFloatingIPPool(self.app, None)
def test_floating_ip_list(self):
arglist = []

View File

@ -62,7 +62,7 @@ class TestCreateFloatingIPPortForwarding(TestFloatingIPPortForwarding):
# Get the command object to test
self.cmd = floating_ip_port_forwarding.CreateFloatingIPPortForwarding(
self.app, self.namespace
self.app, None
)
self.columns = (
@ -358,7 +358,7 @@ class TestDeleteFloatingIPPortForwarding(TestFloatingIPPortForwarding):
self.network_client.find_ip = mock.Mock(return_value=self.floating_ip)
# Get the command object to test
self.cmd = floating_ip_port_forwarding.DeleteFloatingIPPortForwarding(
self.app, self.namespace
self.app, None
)
def test_port_forwarding_delete(self):
@ -496,7 +496,7 @@ class TestListFloatingIPPortForwarding(TestFloatingIPPortForwarding):
self.network_client.find_ip = mock.Mock(return_value=self.floating_ip)
# Get the command object to test
self.cmd = floating_ip_port_forwarding.ListFloatingIPPortForwarding(
self.app, self.namespace
self.app, None
)
def test_port_forwarding_list(self):
@ -567,7 +567,7 @@ class TestSetFloatingIPPortForwarding(TestFloatingIPPortForwarding):
self.network_client.find_ip = mock.Mock(return_value=self.floating_ip)
# Get the command object to test
self.cmd = floating_ip_port_forwarding.SetFloatingIPPortForwarding(
self.app, self.namespace
self.app, None
)
def test_set_nothing(self):
@ -696,7 +696,7 @@ class TestShowFloatingIPPortForwarding(TestFloatingIPPortForwarding):
self.network_client.find_ip = mock.Mock(return_value=self.floating_ip)
# Get the command object to test
self.cmd = floating_ip_port_forwarding.ShowFloatingIPPortForwarding(
self.app, self.namespace
self.app, None
)
def test_show_no_options(self):

View File

@ -54,7 +54,7 @@ class TestListIPAvailability(TestIPAvailability):
def setUp(self):
super(TestListIPAvailability, self).setUp()
self.cmd = ip_availability.ListIPAvailability(self.app, self.namespace)
self.cmd = ip_availability.ListIPAvailability(self.app, None)
self.network_client.network_ip_availabilities = mock.Mock(
return_value=self._ip_availability
)
@ -142,7 +142,7 @@ class TestShowIPAvailability(TestIPAvailability):
)
# Get the command object to test
self.cmd = ip_availability.ShowIPAvailability(self.app, self.namespace)
self.cmd = ip_availability.ShowIPAvailability(self.app, None)
def test_show_no_option(self):
arglist = []

View File

@ -51,9 +51,7 @@ class TestCreateL3ConntrackHelper(TestConntrackHelper):
)
# Get the command object to test
self.cmd = l3_conntrack_helper.CreateConntrackHelper(
self.app, self.namespace
)
self.cmd = l3_conntrack_helper.CreateConntrackHelper(self.app, None)
def test_create_no_options(self):
arglist = []
@ -126,9 +124,7 @@ class TestDeleteL3ConntrackHelper(TestConntrackHelper):
)
# Get the command object to test
self.cmd = l3_conntrack_helper.DeleteConntrackHelper(
self.app, self.namespace
)
self.cmd = l3_conntrack_helper.DeleteConntrackHelper(self.app, None)
def test_delete(self):
arglist = [self.ct_helper.router_id, self.ct_helper.id]
@ -190,9 +186,7 @@ class TestListL3ConntrackHelper(TestConntrackHelper):
)
# Get the command object to test
self.cmd = l3_conntrack_helper.ListConntrackHelper(
self.app, self.namespace
)
self.cmd = l3_conntrack_helper.ListConntrackHelper(self.app, None)
def test_conntrack_helpers_list(self):
arglist = [self.router.id]
@ -227,9 +221,7 @@ class TestSetL3ConntrackHelper(TestConntrackHelper):
)
# Get the command object to test
self.cmd = l3_conntrack_helper.SetConntrackHelper(
self.app, self.namespace
)
self.cmd = l3_conntrack_helper.SetConntrackHelper(self.app, None)
def test_set_nothing(self):
arglist = [
@ -294,9 +286,7 @@ class TestShowL3ConntrackHelper(TestConntrackHelper):
)
# Get the command object to test
self.cmd = l3_conntrack_helper.ShowConntrackHelper(
self.app, self.namespace
)
self.cmd = l3_conntrack_helper.ShowConntrackHelper(self.app, None)
def test_show_no_options(self):
arglist = []

View File

@ -86,7 +86,7 @@ class TestCreateLocalIP(TestLocalIP):
self.network_client.find_port = mock.Mock(return_value=self.port)
# Get the command object to test
self.cmd = local_ip.CreateLocalIP(self.app, self.namespace)
self.cmd = local_ip.CreateLocalIP(self.app, None)
self.projects_mock.get.return_value = self.project
self.domains_mock.get.return_value = self.domain
@ -155,7 +155,7 @@ class TestDeleteLocalIP(TestLocalIP):
)
# Get the command object to test
self.cmd = local_ip.DeleteLocalIP(self.app, self.namespace)
self.cmd = local_ip.DeleteLocalIP(self.app, None)
def test_local_ip_delete(self):
arglist = [
@ -264,7 +264,7 @@ class TestListLocalIP(TestLocalIP):
)
# Get the command object to test
self.cmd = local_ip.ListLocalIP(self.app, self.namespace)
self.cmd = local_ip.ListLocalIP(self.app, None)
def test_local_ip_list(self):
arglist = []
@ -408,7 +408,7 @@ class TestSetLocalIP(TestLocalIP):
)
# Get the command object to test
self.cmd = local_ip.SetLocalIP(self.app, self.namespace)
self.cmd = local_ip.SetLocalIP(self.app, None)
def test_set_nothing(self):
arglist = [
@ -487,7 +487,7 @@ class TestShowLocalIP(TestLocalIP):
)
# Get the command object to test
self.cmd = local_ip.ShowLocalIP(self.app, self.namespace)
self.cmd = local_ip.ShowLocalIP(self.app, None)
def test_show_no_options(self):
arglist = []

View File

@ -53,7 +53,7 @@ class TestCreateLocalIPAssociation(TestLocalIPAssociation):
# Get the command object to test
self.cmd = local_ip_association.CreateLocalIPAssociation(
self.app, self.namespace
self.app, None
)
self.columns = (
@ -137,7 +137,7 @@ class TestDeleteLocalIPAssociation(TestLocalIPAssociation):
)
# Get the command object to test
self.cmd = local_ip_association.DeleteLocalIPAssociation(
self.app, self.namespace
self.app, None
)
def test_local_ip_association_delete(self):
@ -270,9 +270,7 @@ class TestListLocalIPAssociation(TestLocalIPAssociation):
)
self.network_client.find_port = mock.Mock(return_value=self.fixed_port)
# Get the command object to test
self.cmd = local_ip_association.ListLocalIPAssociation(
self.app, self.namespace
)
self.cmd = local_ip_association.ListLocalIPAssociation(self.app, None)
def test_local_ip_association_list(self):
arglist = [self.local_ip.id]

View File

@ -73,7 +73,7 @@ class TestCreateNDPProxy(TestNDPProxy):
)
# Get the command object to test
self.cmd = ndp_proxy.CreateNDPProxy(self.app, self.namespace)
self.cmd = ndp_proxy.CreateNDPProxy(self.app, None)
def test_create_no_options(self):
arglist = []
@ -135,7 +135,7 @@ class TestDeleteNDPProxy(TestNDPProxy):
)
# Get the command object to test
self.cmd = ndp_proxy.DeleteNDPProxy(self.app, self.namespace)
self.cmd = ndp_proxy.DeleteNDPProxy(self.app, None)
def test_delete(self):
arglist = [self.ndp_proxy.id]
@ -208,7 +208,7 @@ class TestListNDPProxy(TestNDPProxy):
self.network_client.ndp_proxies = mock.Mock(return_value=ndp_proxies)
# Get the command object to test
self.cmd = ndp_proxy.ListNDPProxy(self.app, self.namespace)
self.cmd = ndp_proxy.ListNDPProxy(self.app, None)
def test_ndp_proxy_list(self):
arglist = []
@ -348,7 +348,7 @@ class TestSetNDPProxy(TestNDPProxy):
)
# Get the command object to test
self.cmd = ndp_proxy.SetNDPProxy(self.app, self.namespace)
self.cmd = ndp_proxy.SetNDPProxy(self.app, None)
def test_set_nothing(self):
arglist = [
@ -444,7 +444,7 @@ class TestShowNDPProxy(TestNDPProxy):
)
# Get the command object to test
self.cmd = ndp_proxy.ShowNDPProxy(self.app, self.namespace)
self.cmd = ndp_proxy.ShowNDPProxy(self.app, None)
def test_show_no_options(self):
arglist = []

View File

@ -120,7 +120,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
self.network_client.set_tags = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = network.CreateNetwork(self.app, self.namespace)
self.cmd = network.CreateNetwork(self.app, None)
self.projects_mock.get.return_value = self.project
self.domains_mock.get.return_value = self.domain
@ -465,7 +465,7 @@ class TestDeleteNetwork(TestNetwork):
)
# Get the command object to test
self.cmd = network.DeleteNetwork(self.app, self.namespace)
self.cmd = network.DeleteNetwork(self.app, None)
def test_delete_one_network(self):
arglist = [
@ -594,7 +594,7 @@ class TestListNetwork(TestNetwork):
super(TestListNetwork, self).setUp()
# Get the command object to test
self.cmd = network.ListNetwork(self.app, self.namespace)
self.cmd = network.ListNetwork(self.app, None)
self.network_client.networks = mock.Mock(return_value=self._network)
@ -962,7 +962,7 @@ class TestSetNetwork(TestNetwork):
)
# Get the command object to test
self.cmd = network.SetNetwork(self.app, self.namespace)
self.cmd = network.SetNetwork(self.app, None)
def test_set_this(self):
arglist = [
@ -1205,7 +1205,7 @@ class TestShowNetwork(TestNetwork):
)
# Get the command object to test
self.cmd = network.ShowNetwork(self.app, self.namespace)
self.cmd = network.ShowNetwork(self.app, None)
def test_show_no_options(self):
arglist = []
@ -1259,7 +1259,7 @@ class TestUnsetNetwork(TestNetwork):
)
# Get the command object to test
self.cmd = network.UnsetNetwork(self.app, self.namespace)
self.cmd = network.UnsetNetwork(self.app, None)
def test_unset_nothing(self):
arglist = [

View File

@ -38,7 +38,7 @@ class TestAddNetworkToAgent(TestNetworkAgent):
self.network_client.find_network = mock.Mock(return_value=self.net)
self.network_client.name = self.network_client.find_network.name
self.cmd = network_agent.AddNetworkToAgent(self.app, self.namespace)
self.cmd = network_agent.AddNetworkToAgent(self.app, None)
def test_show_no_options(self):
arglist = []
@ -79,7 +79,7 @@ class TestAddRouterAgent(TestNetworkAgent):
self.network_client.get_agent = mock.Mock(return_value=self._agent)
self.network_client.find_router = mock.Mock(return_value=self._router)
self.cmd = network_agent.AddRouterToAgent(self.app, self.namespace)
self.cmd = network_agent.AddRouterToAgent(self.app, None)
def test_add_no_options(self):
arglist = []
@ -123,7 +123,7 @@ class TestDeleteNetworkAgent(TestNetworkAgent):
self.network_client.delete_agent = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = network_agent.DeleteNetworkAgent(self.app, self.namespace)
self.cmd = network_agent.DeleteNetworkAgent(self.app, None)
def test_network_agent_delete(self):
arglist = [
@ -245,7 +245,7 @@ class TestListNetworkAgent(TestNetworkAgent):
)
# Get the command object to test
self.cmd = network_agent.ListNetworkAgent(self.app, self.namespace)
self.cmd = network_agent.ListNetworkAgent(self.app, None)
def test_network_agents_list(self):
arglist = []
@ -375,9 +375,7 @@ class TestRemoveNetworkFromAgent(TestNetworkAgent):
self.network_client.find_network = mock.Mock(return_value=self.net)
self.network_client.name = self.network_client.find_network.name
self.cmd = network_agent.RemoveNetworkFromAgent(
self.app, self.namespace
)
self.cmd = network_agent.RemoveNetworkFromAgent(self.app, None)
def test_show_no_options(self):
arglist = []
@ -433,9 +431,7 @@ class TestRemoveRouterAgent(TestNetworkAgent):
self.network_client.get_agent = mock.Mock(return_value=self._agent)
self.network_client.find_router = mock.Mock(return_value=self._router)
self.cmd = network_agent.RemoveRouterFromAgent(
self.app, self.namespace
)
self.cmd = network_agent.RemoveRouterFromAgent(self.app, None)
def test_remove_no_options(self):
arglist = []
@ -482,7 +478,7 @@ class TestSetNetworkAgent(TestNetworkAgent):
)
# Get the command object to test
self.cmd = network_agent.SetNetworkAgent(self.app, self.namespace)
self.cmd = network_agent.SetNetworkAgent(self.app, None)
def test_set_nothing(self):
arglist = [
@ -597,7 +593,7 @@ class TestShowNetworkAgent(TestNetworkAgent):
)
# Get the command object to test
self.cmd = network_agent.ShowNetworkAgent(self.app, self.namespace)
self.cmd = network_agent.ShowNetworkAgent(self.app, None)
def test_show_no_options(self):
arglist = []

View File

@ -48,7 +48,7 @@ class TestCreateAutoAllocatedTopology(TestAutoAllocatedTopology):
super(TestCreateAutoAllocatedTopology, self).setUp()
self.cmd = network_auto_allocated_topology.CreateAutoAllocatedTopology(
self.app, self.namespace
self.app, None
)
self.network_client.get_auto_allocated_topology = mock.Mock(
return_value=self.topology
@ -153,7 +153,7 @@ class TestValidateAutoAllocatedTopology(TestAutoAllocatedTopology):
super(TestValidateAutoAllocatedTopology, self).setUp()
self.cmd = network_auto_allocated_topology.CreateAutoAllocatedTopology(
self.app, self.namespace
self.app, None
)
self.network_client.validate_auto_allocated_topology = mock.Mock(
return_value=self.topology
@ -226,7 +226,7 @@ class TestDeleteAutoAllocatedTopology(TestAutoAllocatedTopology):
super(TestDeleteAutoAllocatedTopology, self).setUp()
self.cmd = network_auto_allocated_topology.DeleteAutoAllocatedTopology(
self.app, self.namespace
self.app, None
)
self.network_client.delete_auto_allocated_topology = mock.Mock(
return_value=None

View File

@ -48,9 +48,7 @@ class TestAddNetworkFlavorToProfile(TestNetworkFlavor):
return_value=self.service_profile
)
self.cmd = network_flavor.AddNetworkFlavorToProfile(
self.app, self.namespace
)
self.cmd = network_flavor.AddNetworkFlavorToProfile(self.app, None)
def test_show_no_options(self):
arglist = []
@ -109,7 +107,7 @@ class TestCreateNetworkFlavor(TestNetworkFlavor):
)
# Get the command object to test
self.cmd = network_flavor.CreateNetworkFlavor(self.app, self.namespace)
self.cmd = network_flavor.CreateNetworkFlavor(self.app, None)
self.projects_mock.get.return_value = self.project
self.domains_mock.get.return_value = self.domain
@ -226,7 +224,7 @@ class TestDeleteNetworkFlavor(TestNetworkFlavor):
)
# Get the command object to test
self.cmd = network_flavor.DeleteNetworkFlavor(self.app, self.namespace)
self.cmd = network_flavor.DeleteNetworkFlavor(self.app, None)
def test_network_flavor_delete(self):
arglist = [
@ -330,7 +328,7 @@ class TestListNetworkFlavor(TestNetworkFlavor):
)
# Get the command object to test
self.cmd = network_flavor.ListNetworkFlavor(self.app, self.namespace)
self.cmd = network_flavor.ListNetworkFlavor(self.app, None)
def test_network_flavor_list(self):
arglist = []
@ -361,7 +359,7 @@ class TestRemoveNetworkFlavorFromProfile(TestNetworkFlavor):
)
self.cmd = network_flavor.RemoveNetworkFlavorFromProfile(
self.app, self.namespace
self.app, None
)
def test_show_no_options(self):
@ -419,7 +417,7 @@ class TestShowNetworkFlavor(TestNetworkFlavor):
)
# Get the command object to test
self.cmd = network_flavor.ShowNetworkFlavor(self.app, self.namespace)
self.cmd = network_flavor.ShowNetworkFlavor(self.app, None)
def test_show_no_options(self):
arglist = []
@ -464,7 +462,7 @@ class TestSetNetworkFlavor(TestNetworkFlavor):
)
# Get the command object to test
self.cmd = network_flavor.SetNetworkFlavor(self.app, self.namespace)
self.cmd = network_flavor.SetNetworkFlavor(self.app, None)
def test_set_nothing(self):
arglist = [

View File

@ -60,7 +60,7 @@ class TestCreateFlavorProfile(TestFlavorProfile):
self.projects_mock.get.return_value = self.project
# Get the command object to test
self.cmd = network_flavor_profile.CreateNetworkFlavorProfile(
self.app, self.namespace
self.app, None
)
def test_create_all_options(self):
@ -239,7 +239,7 @@ class TestDeleteFlavorProfile(TestFlavorProfile):
# Get the command object to test
self.cmd = network_flavor_profile.DeleteNetworkFlavorProfile(
self.app, self.namespace
self.app, None
)
def test_network_flavor_profile_delete(self):
@ -353,7 +353,7 @@ class TestListFlavorProfile(TestFlavorProfile):
# Get the command object to test
self.cmd = network_flavor_profile.ListNetworkFlavorProfile(
self.app, self.namespace
self.app, None
)
def test_network_flavor_profile_list(self):
@ -396,7 +396,7 @@ class TestShowFlavorProfile(TestFlavorProfile):
# Get the command object to test
self.cmd = network_flavor_profile.ShowNetworkFlavorProfile(
self.app, self.namespace
self.app, None
)
def test_show_all_options(self):
@ -432,7 +432,7 @@ class TestSetFlavorProfile(TestFlavorProfile):
# Get the command object to test
self.cmd = network_flavor_profile.SetNetworkFlavorProfile(
self.app, self.namespace
self.app, None
)
def test_set_nothing(self):

View File

@ -59,7 +59,7 @@ class TestCreateMeter(TestMeter):
return_value=self.new_meter
)
self.projects_mock.get.return_value = self.project
self.cmd = network_meter.CreateMeter(self.app, self.namespace)
self.cmd = network_meter.CreateMeter(self.app, None)
def test_create_no_options(self):
arglist = []
@ -140,7 +140,7 @@ class TestDeleteMeter(TestMeter):
network_fakes.FakeNetworkMeter.get_meter(meter=self.meter_list)
)
self.cmd = network_meter.DeleteMeter(self.app, self.namespace)
self.cmd = network_meter.DeleteMeter(self.app, None)
def test_delete_one_meter(self):
arglist = [
@ -244,7 +244,7 @@ class TestListMeter(TestMeter):
return_value=self.meter_list
)
self.cmd = network_meter.ListMeter(self.app, self.namespace)
self.cmd = network_meter.ListMeter(self.app, None)
def test_meter_list(self):
arglist = []
@ -280,7 +280,7 @@ class TestShowMeter(TestMeter):
def setUp(self):
super(TestShowMeter, self).setUp()
self.cmd = network_meter.ShowMeter(self.app, self.namespace)
self.cmd = network_meter.ShowMeter(self.app, None)
self.network_client.find_metering_label = mock.Mock(
return_value=self.new_meter

View File

@ -69,7 +69,7 @@ class TestCreateMeterRule(TestMeterRule):
return_value=self.new_rule
)
self.projects_mock.get.return_value = self.project
self.cmd = network_meter_rule.CreateMeterRule(self.app, self.namespace)
self.cmd = network_meter_rule.CreateMeterRule(self.app, None)
self.network_client.find_metering_label = mock.Mock(
return_value=fake_meter
)
@ -156,7 +156,7 @@ class TestDeleteMeterRule(TestMeterRule):
)
)
self.cmd = network_meter_rule.DeleteMeterRule(self.app, self.namespace)
self.cmd = network_meter_rule.DeleteMeterRule(self.app, None)
def test_delete_one_rule(self):
arglist = [
@ -266,7 +266,7 @@ class TestListMeterRule(TestMeterRule):
return_value=self.rule_list
)
self.cmd = network_meter_rule.ListMeterRule(self.app, self.namespace)
self.cmd = network_meter_rule.ListMeterRule(self.app, None)
def test_rule_list(self):
arglist = []
@ -309,7 +309,7 @@ class TestShowMeterRule(TestMeterRule):
def setUp(self):
super(TestShowMeterRule, self).setUp()
self.cmd = network_meter_rule.ShowMeterRule(self.app, self.namespace)
self.cmd = network_meter_rule.ShowMeterRule(self.app, None)
self.network_client.find_metering_label_rule = mock.Mock(
return_value=self.new_rule

View File

@ -67,9 +67,7 @@ class TestCreateNetworkQosPolicy(TestQosPolicy):
)
# Get the command object to test
self.cmd = network_qos_policy.CreateNetworkQosPolicy(
self.app, self.namespace
)
self.cmd = network_qos_policy.CreateNetworkQosPolicy(self.app, None)
self.projects_mock.get.return_value = self.project
@ -174,9 +172,7 @@ class TestDeleteNetworkQosPolicy(TestQosPolicy):
)
# Get the command object to test
self.cmd = network_qos_policy.DeleteNetworkQosPolicy(
self.app, self.namespace
)
self.cmd = network_qos_policy.DeleteNetworkQosPolicy(self.app, None)
def test_qos_policy_delete(self):
arglist = [
@ -278,9 +274,7 @@ class TestListNetworkQosPolicy(TestQosPolicy):
)
# Get the command object to test
self.cmd = network_qos_policy.ListNetworkQosPolicy(
self.app, self.namespace
)
self.cmd = network_qos_policy.ListNetworkQosPolicy(self.app, None)
def test_qos_policy_list(self):
arglist = []
@ -361,9 +355,7 @@ class TestSetNetworkQosPolicy(TestQosPolicy):
)
# Get the command object to test
self.cmd = network_qos_policy.SetNetworkQosPolicy(
self.app, self.namespace
)
self.cmd = network_qos_policy.SetNetworkQosPolicy(self.app, None)
def test_set_nothing(self):
arglist = [
@ -463,9 +455,7 @@ class TestShowNetworkQosPolicy(TestQosPolicy):
)
# Get the command object to test
self.cmd = network_qos_policy.ShowNetworkQosPolicy(
self.app, self.namespace
)
self.cmd = network_qos_policy.ShowNetworkQosPolicy(self.app, None)
def test_show_no_options(self):
arglist = []

View File

@ -97,9 +97,7 @@ class TestCreateNetworkQosRuleMinimumBandwidth(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.CreateNetworkQosRule(
self.app, self.namespace
)
self.cmd = network_qos_rule.CreateNetworkQosRule(self.app, None)
def test_create_no_options(self):
arglist = []
@ -206,9 +204,7 @@ class TestCreateNetworkQosRuleMinimumPacketRate(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.CreateNetworkQosRule(
self.app, self.namespace
)
self.cmd = network_qos_rule.CreateNetworkQosRule(self.app, None)
def test_create_no_options(self):
arglist = []
@ -313,9 +309,7 @@ class TestCreateNetworkQosRuleDSCPMarking(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.CreateNetworkQosRule(
self.app, self.namespace
)
self.cmd = network_qos_rule.CreateNetworkQosRule(self.app, None)
def test_create_no_options(self):
arglist = []
@ -417,9 +411,7 @@ class TestCreateNetworkQosRuleBandwidtLimit(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.CreateNetworkQosRule(
self.app, self.namespace
)
self.cmd = network_qos_rule.CreateNetworkQosRule(self.app, None)
def test_create_no_options(self):
arglist = []
@ -567,9 +559,7 @@ class TestDeleteNetworkQosRuleMinimumBandwidth(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.DeleteNetworkQosRule(
self.app, self.namespace
)
self.cmd = network_qos_rule.DeleteNetworkQosRule(self.app, None)
def test_qos_policy_delete(self):
arglist = [
@ -636,9 +626,7 @@ class TestDeleteNetworkQosRuleMinimumPacketRate(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.DeleteNetworkQosRule(
self.app, self.namespace
)
self.cmd = network_qos_rule.DeleteNetworkQosRule(self.app, None)
def test_qos_policy_delete(self):
arglist = [
@ -705,9 +693,7 @@ class TestDeleteNetworkQosRuleDSCPMarking(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.DeleteNetworkQosRule(
self.app, self.namespace
)
self.cmd = network_qos_rule.DeleteNetworkQosRule(self.app, None)
def test_qos_policy_delete(self):
arglist = [
@ -774,9 +760,7 @@ class TestDeleteNetworkQosRuleBandwidthLimit(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.DeleteNetworkQosRule(
self.app, self.namespace
)
self.cmd = network_qos_rule.DeleteNetworkQosRule(self.app, None)
def test_qos_policy_delete(self):
arglist = [
@ -844,7 +828,7 @@ class TestSetNetworkQosRuleMinimumBandwidth(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.SetNetworkQosRule(self.app, self.namespace)
self.cmd = network_qos_rule.SetNetworkQosRule(self.app, None)
def test_set_nothing(self):
arglist = [
@ -948,7 +932,7 @@ class TestSetNetworkQosRuleMinimumPacketRate(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.SetNetworkQosRule(self.app, self.namespace)
self.cmd = network_qos_rule.SetNetworkQosRule(self.app, None)
def test_set_nothing(self):
arglist = [
@ -1052,7 +1036,7 @@ class TestSetNetworkQosRuleDSCPMarking(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.SetNetworkQosRule(self.app, self.namespace)
self.cmd = network_qos_rule.SetNetworkQosRule(self.app, None)
def test_set_nothing(self):
arglist = [
@ -1156,7 +1140,7 @@ class TestSetNetworkQosRuleBandwidthLimit(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.SetNetworkQosRule(self.app, self.namespace)
self.cmd = network_qos_rule.SetNetworkQosRule(self.app, None)
def test_set_nothing(self):
arglist = [
@ -1380,9 +1364,7 @@ class TestListNetworkQosRule(TestNetworkQosRule):
)
)
# Get the command object to test
self.cmd = network_qos_rule.ListNetworkQosRule(
self.app, self.namespace
)
self.cmd = network_qos_rule.ListNetworkQosRule(self.app, None)
def test_qos_rule_list(self):
arglist = [self.qos_policy.id]
@ -1436,9 +1418,7 @@ class TestShowNetworkQosRuleMinimumBandwidth(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.ShowNetworkQosRule(
self.app, self.namespace
)
self.cmd = network_qos_rule.ShowNetworkQosRule(self.app, None)
def test_show_no_options(self):
arglist = []
@ -1506,9 +1486,7 @@ class TestShowNetworkQosRuleMinimumPacketRate(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.ShowNetworkQosRule(
self.app, self.namespace
)
self.cmd = network_qos_rule.ShowNetworkQosRule(self.app, None)
def test_show_no_options(self):
arglist = []
@ -1574,9 +1552,7 @@ class TestShowNetworkQosDSCPMarking(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.ShowNetworkQosRule(
self.app, self.namespace
)
self.cmd = network_qos_rule.ShowNetworkQosRule(self.app, None)
def test_show_no_options(self):
arglist = []
@ -1646,9 +1622,7 @@ class TestShowNetworkQosBandwidthLimit(TestNetworkQosRule):
)
# Get the command object to test
self.cmd = network_qos_rule.ShowNetworkQosRule(
self.app, self.namespace
)
self.cmd = network_qos_rule.ShowNetworkQosRule(self.app, None)
def test_show_no_options(self):
arglist = []

View File

@ -41,9 +41,7 @@ class TestShowNetworkQosRuleType(TestNetworkQosRuleType):
)
# Get the command object to test
self.cmd = _qos_rule_type.ShowNetworkQosRuleType(
self.app, self.namespace
)
self.cmd = _qos_rule_type.ShowNetworkQosRuleType(self.app, None)
def test_show_no_options(self):
arglist = []
@ -93,9 +91,7 @@ class TestListNetworkQosRuleType(TestNetworkQosRuleType):
)
# Get the command object to test
self.cmd = _qos_rule_type.ListNetworkQosRuleType(
self.app, self.namespace
)
self.cmd = _qos_rule_type.ListNetworkQosRuleType(self.app, None)
def test_qos_rule_type_list(self):
arglist = []

View File

@ -70,7 +70,7 @@ class TestCreateNetworkRBAC(TestNetworkRBAC):
super(TestCreateNetworkRBAC, self).setUp()
# Get the command object to test
self.cmd = network_rbac.CreateNetworkRBAC(self.app, self.namespace)
self.cmd = network_rbac.CreateNetworkRBAC(self.app, None)
self.network_client.create_rbac_policy = mock.Mock(
return_value=self.rbac_policy
@ -349,7 +349,7 @@ class TestDeleteNetworkRBAC(TestNetworkRBAC):
)
# Get the command object to test
self.cmd = network_rbac.DeleteNetworkRBAC(self.app, self.namespace)
self.cmd = network_rbac.DeleteNetworkRBAC(self.app, None)
def test_network_rbac_delete(self):
arglist = [
@ -460,7 +460,7 @@ class TestListNetworkRABC(TestNetworkRBAC):
super(TestListNetworkRABC, self).setUp()
# Get the command object to test
self.cmd = network_rbac.ListNetworkRBAC(self.app, self.namespace)
self.cmd = network_rbac.ListNetworkRBAC(self.app, None)
self.network_client.rbac_policies = mock.Mock(
return_value=self.rbac_policies
@ -562,7 +562,7 @@ class TestSetNetworkRBAC(TestNetworkRBAC):
super(TestSetNetworkRBAC, self).setUp()
# Get the command object to test
self.cmd = network_rbac.SetNetworkRBAC(self.app, self.namespace)
self.cmd = network_rbac.SetNetworkRBAC(self.app, None)
self.network_client.find_rbac_policy = mock.Mock(
return_value=self.rbac_policy
@ -637,7 +637,7 @@ class TestShowNetworkRBAC(TestNetworkRBAC):
super(TestShowNetworkRBAC, self).setUp()
# Get the command object to test
self.cmd = network_rbac.ShowNetworkRBAC(self.app, self.namespace)
self.cmd = network_rbac.ShowNetworkRBAC(self.app, None)
self.network_client.find_rbac_policy = mock.Mock(
return_value=self.rbac_policy

View File

@ -66,9 +66,7 @@ class TestCreateNetworkSegment(TestNetworkSegment):
)
# Get the command object to test
self.cmd = network_segment.CreateNetworkSegment(
self.app, self.namespace
)
self.cmd = network_segment.CreateNetworkSegment(self.app, None)
def test_create_no_options(self):
# Missing required args should bail here
@ -180,9 +178,7 @@ class TestDeleteNetworkSegment(TestNetworkSegment):
)
# Get the command object to test
self.cmd = network_segment.DeleteNetworkSegment(
self.app, self.namespace
)
self.cmd = network_segment.DeleteNetworkSegment(self.app, None)
def test_delete(self):
arglist = [
@ -293,7 +289,7 @@ class TestListNetworkSegment(TestNetworkSegment):
super(TestListNetworkSegment, self).setUp()
# Get the command object to test
self.cmd = network_segment.ListNetworkSegment(self.app, self.namespace)
self.cmd = network_segment.ListNetworkSegment(self.app, None)
self.network_client.find_network = mock.Mock(
return_value=self._network
@ -364,7 +360,7 @@ class TestSetNetworkSegment(TestNetworkSegment):
)
# Get the command object to test
self.cmd = network_segment.SetNetworkSegment(self.app, self.namespace)
self.cmd = network_segment.SetNetworkSegment(self.app, None)
def test_set_no_options(self):
arglist = [
@ -441,7 +437,7 @@ class TestShowNetworkSegment(TestNetworkSegment):
)
# Get the command object to test
self.cmd = network_segment.ShowNetworkSegment(self.app, self.namespace)
self.cmd = network_segment.ShowNetworkSegment(self.app, None)
def test_show_no_options(self):
# Missing required args should bail here

View File

@ -84,7 +84,7 @@ class TestCreateNetworkSegmentRange(TestNetworkSegmentRange):
# Get the command object to test
self.cmd = network_segment_range.CreateNetworkSegmentRange(
self.app, self.namespace
self.app, None
)
def test_create_no_options(self):
@ -360,7 +360,7 @@ class TestDeleteNetworkSegmentRange(TestNetworkSegmentRange):
# Get the command object to test
self.cmd = network_segment_range.DeleteNetworkSegmentRange(
self.app, self.namespace
self.app, None
)
def test_delete(self):
@ -499,7 +499,7 @@ class TestListNetworkSegmentRange(TestNetworkSegmentRange):
# Get the command object to test
self.cmd = network_segment_range.ListNetworkSegmentRange(
self.app, self.namespace
self.app, None
)
def test_list_no_option(self):
@ -572,9 +572,7 @@ class TestSetNetworkSegmentRange(TestNetworkSegmentRange):
)
# Get the command object to test
self.cmd = network_segment_range.SetNetworkSegmentRange(
self.app, self.namespace
)
self.cmd = network_segment_range.SetNetworkSegmentRange(self.app, None)
def test_set_no_options(self):
arglist = [
@ -670,7 +668,7 @@ class TestShowNetworkSegmentRange(TestNetworkSegmentRange):
# Get the command object to test
self.cmd = network_segment_range.ShowNetworkSegmentRange(
self.app, self.namespace
self.app, None
)
def test_show_no_options(self):

View File

@ -56,9 +56,7 @@ class TestListNetworkServiceProvider(TestNetworkServiceProvider):
return_value=self.provider_list
)
self.cmd = service_provider.ListNetworkServiceProvider(
self.app, self.namespace
)
self.cmd = service_provider.ListNetworkServiceProvider(self.app, None)
def test_network_service_provider_list(self):
arglist = []

View File

@ -92,7 +92,7 @@ class TestCreateNetworkTrunk(TestNetworkTrunk):
)
# Get the command object to test
self.cmd = network_trunk.CreateNetworkTrunk(self.app, self.namespace)
self.cmd = network_trunk.CreateNetworkTrunk(self.app, None)
self.projects_mock.get.return_value = self.project
self.domains_mock.get.return_value = self.domain
@ -329,7 +329,7 @@ class TestDeleteNetworkTrunk(TestNetworkTrunk):
self.domains_mock.get.return_value = self.domain
# Get the command object to test
self.cmd = network_trunk.DeleteNetworkTrunk(self.app, self.namespace)
self.cmd = network_trunk.DeleteNetworkTrunk(self.app, None)
def test_delete_trunkx(self):
arglist = [
@ -423,7 +423,7 @@ class TestShowNetworkTrunk(TestNetworkTrunk):
self.domains_mock.get.return_value = self.domain
# Get the command object to test
self.cmd = network_trunk.ShowNetworkTrunk(self.app, self.namespace)
self.cmd = network_trunk.ShowNetworkTrunk(self.app, None)
def test_show_no_options(self):
arglist = []
@ -495,7 +495,7 @@ class TestListNetworkTrunk(TestNetworkTrunk):
self.domains_mock.get.return_value = self.domain
# Get the command object to test
self.cmd = network_trunk.ListNetworkTrunk(self.app, self.namespace)
self.cmd = network_trunk.ListNetworkTrunk(self.app, None)
def test_trunk_list_no_option(self):
arglist = []
@ -581,7 +581,7 @@ class TestSetNetworkTrunk(TestNetworkTrunk):
self.domains_mock.get.return_value = self.domain
# Get the command object to test
self.cmd = network_trunk.SetNetworkTrunk(self.app, self.namespace)
self.cmd = network_trunk.SetNetworkTrunk(self.app, None)
def _test_set_network_trunk_attr(self, attr, value):
arglist = [
@ -842,7 +842,7 @@ class TestListNetworkSubport(TestNetworkTrunk):
)
# Get the command object to test
self.cmd = network_trunk.ListNetworkSubport(self.app, self.namespace)
self.cmd = network_trunk.ListNetworkSubport(self.app, None)
def test_subport_list(self):
arglist = [
@ -915,7 +915,7 @@ class TestUnsetNetworkTrunk(TestNetworkTrunk):
)
# Get the command object to test
self.cmd = network_trunk.UnsetNetworkTrunk(self.app, self.namespace)
self.cmd = network_trunk.UnsetNetworkTrunk(self.app, None)
def test_unset_network_trunk_subport(self):
subport = self._trunk['sub_ports'][0]

View File

@ -143,7 +143,7 @@ class TestCreatePort(TestPort):
)
self.network_client.find_extension = mock.Mock(return_value=[])
# Get the command object to test
self.cmd = port.CreatePort(self.app, self.namespace)
self.cmd = port.CreatePort(self.app, None)
def test_create_default_options(self):
arglist = [
@ -1125,7 +1125,7 @@ class TestDeletePort(TestPort):
ports=self._ports
)
# Get the command object to test
self.cmd = port.DeletePort(self.app, self.namespace)
self.cmd = port.DeletePort(self.app, None)
def test_port_delete(self):
arglist = [
@ -1260,7 +1260,7 @@ class TestListPort(TestPort):
self.compute_client = self.app.client_manager.compute
# Get the command object to test
self.cmd = port.ListPort(self.app, self.namespace)
self.cmd = port.ListPort(self.app, None)
def test_port_list_no_options(self):
arglist = []
@ -1730,7 +1730,7 @@ class TestSetPort(TestPort):
self.network_client.set_tags = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = port.SetPort(self.app, self.namespace)
self.cmd = port.SetPort(self.app, None)
def test_set_port_defaults(self):
arglist = [
@ -2512,7 +2512,7 @@ class TestShowPort(TestPort):
self.network_client.find_port = mock.Mock(return_value=self._port)
# Get the command object to test
self.cmd = port.ShowPort(self.app, self.namespace)
self.cmd = port.ShowPort(self.app, None)
def test_show_no_options(self):
arglist = []
@ -2577,7 +2577,7 @@ class TestUnsetPort(TestPort):
self.network_client.update_port = mock.Mock(return_value=None)
self.network_client.set_tags = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = port.UnsetPort(self.app, self.namespace)
self.cmd = port.UnsetPort(self.app, None)
def test_unset_port_parameters(self):
arglist = [

View File

@ -44,7 +44,7 @@ class TestAddPortToRouter(TestRouter):
self.network_client.find_router = mock.Mock(return_value=self._router)
self.network_client.find_port = mock.Mock(return_value=self._port)
self.cmd = router.AddPortToRouter(self.app, self.namespace)
self.cmd = router.AddPortToRouter(self.app, None)
def test_add_port_no_option(self):
arglist = []
@ -94,7 +94,7 @@ class TestAddSubnetToRouter(TestRouter):
self.network_client.find_router = mock.Mock(return_value=self._router)
self.network_client.find_subnet = mock.Mock(return_value=self._subnet)
self.cmd = router.AddSubnetToRouter(self.app, self.namespace)
self.cmd = router.AddSubnetToRouter(self.app, None)
def test_add_subnet_no_option(self):
arglist = []
@ -174,7 +174,7 @@ class TestCreateRouter(TestRouter):
side_effect=lambda name: self._extensions.get(name)
)
# Get the command object to test
self.cmd = router.CreateRouter(self.app, self.namespace)
self.cmd = router.CreateRouter(self.app, None)
def test_create_no_options(self):
arglist = []
@ -493,7 +493,7 @@ class TestDeleteRouter(TestRouter):
)
# Get the command object to test
self.cmd = router.DeleteRouter(self.app, self.namespace)
self.cmd = router.DeleteRouter(self.app, None)
def test_router_delete(self):
arglist = [
@ -645,7 +645,7 @@ class TestListRouter(TestRouter):
super(TestListRouter, self).setUp()
# Get the command object to test
self.cmd = router.ListRouter(self.app, self.namespace)
self.cmd = router.ListRouter(self.app, None)
self.network_client.agent_hosted_routers = mock.Mock(
return_value=self.routers
@ -910,7 +910,7 @@ class TestRemovePortFromRouter(TestRouter):
self.network_client.find_router = mock.Mock(return_value=self._router)
self.network_client.find_port = mock.Mock(return_value=self._port)
self.cmd = router.RemovePortFromRouter(self.app, self.namespace)
self.cmd = router.RemovePortFromRouter(self.app, None)
def test_remove_port_no_option(self):
arglist = []
@ -957,7 +957,7 @@ class TestRemoveSubnetFromRouter(TestRouter):
self.network_client.find_router = mock.Mock(return_value=self._router)
self.network_client.find_subnet = mock.Mock(return_value=self._subnet)
self.cmd = router.RemoveSubnetFromRouter(self.app, self.namespace)
self.cmd = router.RemoveSubnetFromRouter(self.app, None)
def test_remove_subnet_no_option(self):
arglist = []
@ -997,7 +997,7 @@ class TestAddExtraRoutesToRouter(TestRouter):
self.network_client.add_extra_routes_to_router = mock.Mock(
return_value=self._router
)
self.cmd = router.AddExtraRoutesToRouter(self.app, self.namespace)
self.cmd = router.AddExtraRoutesToRouter(self.app, None)
self.network_client.find_router = mock.Mock(return_value=self._router)
def test_add_no_extra_route(self):
@ -1086,7 +1086,7 @@ class TestRemoveExtraRoutesFromRouter(TestRouter):
self.network_client.remove_extra_routes_from_router = mock.Mock(
return_value=self._router
)
self.cmd = router.RemoveExtraRoutesFromRouter(self.app, self.namespace)
self.cmd = router.RemoveExtraRoutesFromRouter(self.app, None)
self.network_client.find_router = mock.Mock(return_value=self._router)
def test_remove_no_extra_route(self):
@ -1192,7 +1192,7 @@ class TestSetRouter(TestRouter):
side_effect=lambda name: self._extensions.get(name)
)
# Get the command object to test
self.cmd = router.SetRouter(self.app, self.namespace)
self.cmd = router.SetRouter(self.app, None)
def test_set_this(self):
arglist = [
@ -1716,7 +1716,7 @@ class TestShowRouter(TestRouter):
self.network_client.ports = mock.Mock(return_value=[self._port])
# Get the command object to test
self.cmd = router.ShowRouter(self.app, self.namespace)
self.cmd = router.ShowRouter(self.app, None)
def test_show_no_options(self):
arglist = []
@ -1831,7 +1831,7 @@ class TestUnsetRouter(TestRouter):
return_value=None
)
# Get the command object to test
self.cmd = router.UnsetRouter(self.app, self.namespace)
self.cmd = router.UnsetRouter(self.app, None)
def test_unset_router_params(self):
arglist = [
@ -2098,7 +2098,7 @@ class TestCreateMultipleGateways(TestGatewayOps):
self._router.status,
format_columns.ListColumn(self._router.tags),
)
self.cmd = router.CreateRouter(self.app, self.namespace)
self.cmd = router.CreateRouter(self.app, None)
def test_create_one_gateway(self):
arglist = [
@ -2204,7 +2204,7 @@ class TestUpdateMultipleGateways(TestGatewayOps):
self.network_client.update_external_gateways = mock.Mock(
return_value=None
)
self.cmd = router.SetRouter(self.app, self.namespace)
self.cmd = router.SetRouter(self.app, None)
def test_update_one_gateway(self):
arglist = [
@ -2297,7 +2297,7 @@ class TestAddGatewayRouter(TestGatewayOps):
def setUp(self):
super().setUp()
# Get the command object to test
self.cmd = router.AddGatewayToRouter(self.app, self.namespace)
self.cmd = router.AddGatewayToRouter(self.app, None)
self.network_client.add_external_gateways.return_value = self._router
@ -2421,7 +2421,7 @@ class TestRemoveGatewayRouter(TestGatewayOps):
def setUp(self):
super().setUp()
# Get the command object to test
self.cmd = router.RemoveGatewayFromRouter(self.app, self.namespace)
self.cmd = router.RemoveGatewayFromRouter(self.app, None)
self.network_client.remove_external_gateways.return_value = (
self._router

View File

@ -72,7 +72,7 @@ class TestCreateSecurityGroupNetwork(TestSecurityGroupNetwork):
self.network_client.set_tags = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = security_group.CreateSecurityGroup(self.app, self.namespace)
self.cmd = security_group.CreateSecurityGroup(self.app, None)
def test_create_no_options(self):
self.assertRaises(
@ -190,7 +190,7 @@ class TestDeleteSecurityGroupNetwork(TestSecurityGroupNetwork):
)
# Get the command object to test
self.cmd = security_group.DeleteSecurityGroup(self.app, self.namespace)
self.cmd = security_group.DeleteSecurityGroup(self.app, None)
def test_security_group_delete(self):
arglist = [
@ -296,7 +296,7 @@ class TestListSecurityGroupNetwork(TestSecurityGroupNetwork):
)
# Get the command object to test
self.cmd = security_group.ListSecurityGroup(self.app, self.namespace)
self.cmd = security_group.ListSecurityGroup(self.app, None)
def test_security_group_list_no_options(self):
arglist = []
@ -431,7 +431,7 @@ class TestSetSecurityGroupNetwork(TestSecurityGroupNetwork):
self.network_client.set_tags = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = security_group.SetSecurityGroup(self.app, self.namespace)
self.cmd = security_group.SetSecurityGroup(self.app, None)
def test_set_no_options(self):
self.assertRaises(
@ -556,7 +556,7 @@ class TestShowSecurityGroupNetwork(TestSecurityGroupNetwork):
)
# Get the command object to test
self.cmd = security_group.ShowSecurityGroup(self.app, self.namespace)
self.cmd = security_group.ShowSecurityGroup(self.app, None)
def test_show_no_options(self):
self.assertRaises(
@ -602,7 +602,7 @@ class TestUnsetSecurityGroupNetwork(TestSecurityGroupNetwork):
self.network_client.set_tags = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = security_group.UnsetSecurityGroup(self.app, self.namespace)
self.cmd = security_group.UnsetSecurityGroup(self.app, None)
def test_set_no_options(self):
self.assertRaises(

View File

@ -103,9 +103,7 @@ class TestCreateSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
self.domains_mock.get.return_value = self.domain
# Get the command object to test
self.cmd = security_group_rule.CreateSecurityGroupRule(
self.app, self.namespace
)
self.cmd = security_group_rule.CreateSecurityGroupRule(self.app, None)
def test_create_no_options(self):
self.assertRaises(
@ -985,9 +983,7 @@ class TestDeleteSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
)
# Get the command object to test
self.cmd = security_group_rule.DeleteSecurityGroupRule(
self.app, self.namespace
)
self.cmd = security_group_rule.DeleteSecurityGroupRule(self.app, None)
def test_security_group_rule_delete(self):
arglist = [
@ -1156,9 +1152,7 @@ class TestListSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
)
# Get the command object to test
self.cmd = security_group_rule.ListSecurityGroupRule(
self.app, self.namespace
)
self.cmd = security_group_rule.ListSecurityGroupRule(self.app, None)
def test_list_default(self):
self._security_group_rule_tcp.port_range_min = 80
@ -1312,9 +1306,7 @@ class TestShowSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
)
# Get the command object to test
self.cmd = security_group_rule.ShowSecurityGroupRule(
self.app, self.namespace
)
self.cmd = security_group_rule.ShowSecurityGroupRule(self.app, None)
def test_show_no_options(self):
self.assertRaises(

View File

@ -258,7 +258,7 @@ class TestCreateSubnet(TestSubnet):
super(TestCreateSubnet, self).setUp()
# Get the command object to test
self.cmd = subnet_v2.CreateSubnet(self.app, self.namespace)
self.cmd = subnet_v2.CreateSubnet(self.app, None)
self.projects_mock.get.return_value = self.project
self.domains_mock.get.return_value = self.domain
@ -726,7 +726,7 @@ class TestDeleteSubnet(TestSubnet):
)
# Get the command object to test
self.cmd = subnet_v2.DeleteSubnet(self.app, self.namespace)
self.cmd = subnet_v2.DeleteSubnet(self.app, None)
def test_subnet_delete(self):
arglist = [
@ -851,7 +851,7 @@ class TestListSubnet(TestSubnet):
super(TestListSubnet, self).setUp()
# Get the command object to test
self.cmd = subnet_v2.ListSubnet(self.app, self.namespace)
self.cmd = subnet_v2.ListSubnet(self.app, None)
self.network_client.subnets = mock.Mock(return_value=self._subnet)
@ -1183,7 +1183,7 @@ class TestSetSubnet(TestSubnet):
self.network_client.update_subnet = mock.Mock(return_value=None)
self.network_client.set_tags = mock.Mock(return_value=None)
self.network_client.find_subnet = mock.Mock(return_value=self._subnet)
self.cmd = subnet_v2.SetSubnet(self.app, self.namespace)
self.cmd = subnet_v2.SetSubnet(self.app, None)
def test_set_this(self):
arglist = [
@ -1510,7 +1510,7 @@ class TestShowSubnet(TestSubnet):
super(TestShowSubnet, self).setUp()
# Get the command object to test
self.cmd = subnet_v2.ShowSubnet(self.app, self.namespace)
self.cmd = subnet_v2.ShowSubnet(self.app, None)
self.network_client.find_subnet = mock.Mock(return_value=self._subnet)
@ -1575,7 +1575,7 @@ class TestUnsetSubnet(TestSubnet):
self.network_client.update_subnet = mock.Mock(return_value=None)
self.network_client.set_tags = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = subnet_v2.UnsetSubnet(self.app, self.namespace)
self.cmd = subnet_v2.UnsetSubnet(self.app, None)
def test_unset_subnet_params(self):
arglist = [

View File

@ -82,7 +82,7 @@ class TestCreateSubnetPool(TestSubnetPool):
self.network_client.set_tags = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = subnet_pool.CreateSubnetPool(self.app, self.namespace)
self.cmd = subnet_pool.CreateSubnetPool(self.app, None)
self.network_client.find_address_scope = mock.Mock(
return_value=self._address_scope
@ -394,7 +394,7 @@ class TestDeleteSubnetPool(TestSubnetPool):
)
# Get the command object to test
self.cmd = subnet_pool.DeleteSubnetPool(self.app, self.namespace)
self.cmd = subnet_pool.DeleteSubnetPool(self.app, None)
def test_subnet_pool_delete(self):
arglist = [
@ -512,7 +512,7 @@ class TestListSubnetPool(TestSubnetPool):
super(TestListSubnetPool, self).setUp()
# Get the command object to test
self.cmd = subnet_pool.ListSubnetPool(self.app, self.namespace)
self.cmd = subnet_pool.ListSubnetPool(self.app, None)
self.network_client.subnet_pools = mock.Mock(
return_value=self._subnet_pools
@ -746,7 +746,7 @@ class TestSetSubnetPool(TestSubnetPool):
)
# Get the command object to test
self.cmd = subnet_pool.SetSubnetPool(self.app, self.namespace)
self.cmd = subnet_pool.SetSubnetPool(self.app, None)
def test_set_this(self):
arglist = [
@ -1084,7 +1084,7 @@ class TestShowSubnetPool(TestSubnetPool):
)
# Get the command object to test
self.cmd = subnet_pool.ShowSubnetPool(self.app, self.namespace)
self.cmd = subnet_pool.ShowSubnetPool(self.app, None)
def test_show_no_options(self):
arglist = []
@ -1128,7 +1128,7 @@ class TestUnsetSubnetPool(TestSubnetPool):
self.network_client.update_subnet_pool = mock.Mock(return_value=None)
self.network_client.set_tags = mock.Mock(return_value=None)
# Get the command object to test
self.cmd = subnet_pool.UnsetSubnetPool(self.app, self.namespace)
self.cmd = subnet_pool.UnsetSubnetPool(self.app, None)
def _test_unset_tags(self, with_tags=True):
if with_tags: