Refactor verify_update in proxy tests
Move as much common stuff into the base method so the update verification becomes easier. Change-Id: I730344026a5a7481b17d6b4f526d9660de90a0eb
This commit is contained in:
@@ -51,10 +51,4 @@ class TestClusteringProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={'paginated': True, 'limit': 2})
|
expected_kwargs={'paginated': True, 'limit': 2})
|
||||||
|
|
||||||
def test_cluster_update(self):
|
def test_cluster_update(self):
|
||||||
kwargs = {"name": "new-name"}
|
self.verify_update(self.proxy.update_cluster, cluster.Cluster)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_cluster,
|
|
||||||
method_args=['resource_or_id'],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[cluster.Cluster, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|||||||
@@ -73,13 +73,7 @@ class TestComputeProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={"paginated": True, "query": 1})
|
expected_kwargs={"paginated": True, "query": 1})
|
||||||
|
|
||||||
def test_flavor_update(self):
|
def test_flavor_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_flavor, flavor.Flavor)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_flavor,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[flavor.Flavor, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_image_delete(self):
|
def test_image_delete(self):
|
||||||
self.verify_delete2(image.Image, self.proxy.delete_image, False)
|
self.verify_delete2(image.Image, self.proxy.delete_image, False)
|
||||||
@@ -139,13 +133,7 @@ class TestComputeProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={"paginated": False})
|
expected_kwargs={"paginated": False})
|
||||||
|
|
||||||
def test_keypair_update(self):
|
def test_keypair_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_keypair, keypair.Keypair)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_keypair,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[keypair.Keypair, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_limits_get(self):
|
def test_limits_get(self):
|
||||||
self.verify_get2('openstack.proxy.BaseProxy._get',
|
self.verify_get2('openstack.proxy.BaseProxy._get',
|
||||||
@@ -186,14 +174,8 @@ class TestComputeProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={"paginated": False})
|
expected_kwargs={"paginated": False})
|
||||||
|
|
||||||
def test_server_interface_update(self):
|
def test_server_interface_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_server_interface,
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
server_interface.ServerInterface)
|
||||||
self.proxy.update_server_interface,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[server_interface.ServerInterface,
|
|
||||||
"resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_server_ip_find(self):
|
def test_server_ip_find(self):
|
||||||
self.verify_find('openstack.compute.v2.server_ip.ServerIP.find',
|
self.verify_find('openstack.compute.v2.server_ip.ServerIP.find',
|
||||||
@@ -245,13 +227,7 @@ class TestComputeProxy(test_proxy_base.TestProxyBase):
|
|||||||
"changes-since": 1, "image": 2})
|
"changes-since": 1, "image": 2})
|
||||||
|
|
||||||
def test_server_update(self):
|
def test_server_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_server, server.Server)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_server,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[server.Server, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_server_wait_for(self):
|
def test_server_wait_for(self):
|
||||||
value = server.Server(attrs={'id': '1234'})
|
value = server.Server(attrs={'id': '1234'})
|
||||||
|
|||||||
@@ -101,14 +101,7 @@ class TestDatabaseProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_instance_update(self):
|
def test_instance_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_instance, instance.Instance)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_instance,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[instance.Instance,
|
|
||||||
"resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_user_create_attrs(self):
|
def test_user_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
|
|||||||
@@ -52,13 +52,7 @@ class TestIdentityProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_role_update(self):
|
def test_role_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_role, role.Role)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_role,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[role.Role, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_tenant_create_attrs(self):
|
def test_tenant_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -90,13 +84,7 @@ class TestIdentityProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_tenant_update(self):
|
def test_tenant_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_tenant, tenant.Tenant)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_tenant,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[tenant.Tenant, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_user_create_attrs(self):
|
def test_user_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -128,10 +116,4 @@ class TestIdentityProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_user_update(self):
|
def test_user_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_user, user.User)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_user,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[user.User, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|||||||
@@ -61,14 +61,7 @@ class TestIdentityProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_credential_update(self):
|
def test_credential_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_credential, credential.Credential)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_credential,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[credential.Credential,
|
|
||||||
"resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_domain_create_attrs(self):
|
def test_domain_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -100,13 +93,7 @@ class TestIdentityProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_domain_update(self):
|
def test_domain_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_domain, domain.Domain)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_domain,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[domain.Domain, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_endpoint_create_attrs(self):
|
def test_endpoint_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -140,14 +127,7 @@ class TestIdentityProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_endpoint_update(self):
|
def test_endpoint_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_endpoint, endpoint.Endpoint)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_endpoint,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[endpoint.Endpoint,
|
|
||||||
"resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_group_create_attrs(self):
|
def test_group_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -179,13 +159,7 @@ class TestIdentityProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_group_update(self):
|
def test_group_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_group, group.Group)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_group,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[group.Group, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_policy_create_attrs(self):
|
def test_policy_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -217,13 +191,7 @@ class TestIdentityProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_policy_update(self):
|
def test_policy_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_policy, policy.Policy)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_policy,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[policy.Policy, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_project_create_attrs(self):
|
def test_project_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -255,13 +223,7 @@ class TestIdentityProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_project_update(self):
|
def test_project_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_project, project.Project)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_project,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[project.Project, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_service_create_attrs(self):
|
def test_service_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -293,13 +255,7 @@ class TestIdentityProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_service_update(self):
|
def test_service_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_service, service.Service)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_service,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[service.Service, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_user_create_attrs(self):
|
def test_user_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -331,13 +287,7 @@ class TestIdentityProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_user_update(self):
|
def test_user_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_user, user.User)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_user,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[user.User, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_trust_create_attrs(self):
|
def test_trust_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -369,10 +319,4 @@ class TestIdentityProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_trust_update(self):
|
def test_trust_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_trust, trust.Trust)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_trust,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[trust.Trust, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|||||||
@@ -50,10 +50,4 @@ class TestImageProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={'paginated': True})
|
expected_kwargs={'paginated': True})
|
||||||
|
|
||||||
def test_image_update(self):
|
def test_image_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_image, image.Image)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_image,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[image.Image, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|||||||
@@ -37,13 +37,7 @@ class TestImageProxy(test_proxy_base.TestProxyBase):
|
|||||||
self.verify_delete2(image.Image, self.proxy.delete_image, True)
|
self.verify_delete2(image.Image, self.proxy.delete_image, True)
|
||||||
|
|
||||||
def test_image_update(self):
|
def test_image_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_image, image.Image)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_image,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[image.Image, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_image_get(self):
|
def test_image_get(self):
|
||||||
self.verify_get2('openstack.proxy.BaseProxy._get',
|
self.verify_get2('openstack.proxy.BaseProxy._get',
|
||||||
@@ -71,13 +65,7 @@ class TestImageProxy(test_proxy_base.TestProxyBase):
|
|||||||
self.verify_delete2(member.Member, self.proxy.delete_member, True)
|
self.verify_delete2(member.Member, self.proxy.delete_member, True)
|
||||||
|
|
||||||
def test_member_update(self):
|
def test_member_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_member, member.Member)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_member,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[member.Member, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_member_get(self):
|
def test_member_get(self):
|
||||||
self.verify_get2('openstack.proxy.BaseProxy._get',
|
self.verify_get2('openstack.proxy.BaseProxy._get',
|
||||||
|
|||||||
@@ -54,14 +54,7 @@ class TestKeystoreProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_container_update(self):
|
def test_container_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_container, container.Container)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_container,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[container.Container,
|
|
||||||
"resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_order_create_attrs(self):
|
def test_order_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -93,13 +86,7 @@ class TestKeystoreProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_order_update(self):
|
def test_order_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_order, order.Order)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_order,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[order.Order, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_secret_create_attrs(self):
|
def test_secret_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -131,10 +118,4 @@ class TestKeystoreProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_secret_update(self):
|
def test_secret_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_secret, secret.Secret)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_secret,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[secret.Secret, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|||||||
@@ -80,14 +80,7 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_floating_ip_update(self):
|
def test_floating_ip_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_ip, floating_ip.FloatingIP)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_ip,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[floating_ip.FloatingIP,
|
|
||||||
"resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_health_monitor_create_attrs(self):
|
def test_health_monitor_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -123,14 +116,8 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_health_monitor_update(self):
|
def test_health_monitor_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_health_monitor,
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
health_monitor.HealthMonitor)
|
||||||
self.proxy.update_health_monitor,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[health_monitor.HealthMonitor,
|
|
||||||
"resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_listener_create_attrs(self):
|
def test_listener_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -164,14 +151,7 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_listener_update(self):
|
def test_listener_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_listener, listener.Listener)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_listener,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[listener.Listener,
|
|
||||||
"resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_load_balancer_create_attrs(self):
|
def test_load_balancer_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -207,14 +187,8 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_load_balancer_update(self):
|
def test_load_balancer_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_load_balancer,
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
load_balancer.LoadBalancer)
|
||||||
self.proxy.update_load_balancer,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[load_balancer.LoadBalancer,
|
|
||||||
"resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_metering_label_create_attrs(self):
|
def test_metering_label_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -250,14 +224,8 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_metering_label_update(self):
|
def test_metering_label_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_metering_label,
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
metering_label.MeteringLabel)
|
||||||
self.proxy.update_metering_label,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[metering_label.MeteringLabel,
|
|
||||||
"resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_metering_label_rule_create_attrs(self):
|
def test_metering_label_rule_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -295,16 +263,8 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_metering_label_rule_update(self):
|
def test_metering_label_rule_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_metering_label_rule,
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
metering_label_rule.MeteringLabelRule)
|
||||||
self.proxy.update_metering_label_rule,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[
|
|
||||||
metering_label_rule.MeteringLabelRule,
|
|
||||||
"resource_or_id"
|
|
||||||
],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_network_create_attrs(self):
|
def test_network_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -336,13 +296,7 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_network_update(self):
|
def test_network_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_network, network.Network)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_network,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[network.Network, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_pool_member_create_attrs(self):
|
def test_pool_member_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -377,14 +331,8 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_pool_member_update(self):
|
def test_pool_member_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_pool_member,
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
pool_member.PoolMember)
|
||||||
self.proxy.update_pool_member,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[pool_member.PoolMember,
|
|
||||||
"resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_pool_create_attrs(self):
|
def test_pool_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -416,13 +364,7 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_pool_update(self):
|
def test_pool_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_pool, pool.Pool)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_pool,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[pool.Pool, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_port_create_attrs(self):
|
def test_port_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -454,13 +396,7 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_port_update(self):
|
def test_port_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_port, port.Port)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_port,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[port.Port, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_quotas(self):
|
def test_quotas(self):
|
||||||
self.verify_list2(self.proxy.quotas,
|
self.verify_list2(self.proxy.quotas,
|
||||||
@@ -497,13 +433,7 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_router_update(self):
|
def test_router_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_router, router.Router)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_router,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[router.Router, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_security_group_create_attrs(self):
|
def test_security_group_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -539,14 +469,8 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_security_group_update(self):
|
def test_security_group_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_security_group,
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
security_group.SecurityGroup)
|
||||||
self.proxy.update_security_group,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[security_group.SecurityGroup,
|
|
||||||
"resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_security_group_open_port(self):
|
def test_security_group_open_port(self):
|
||||||
mock_class = 'openstack.network.v2._proxy.Proxy'
|
mock_class = 'openstack.network.v2._proxy.Proxy'
|
||||||
@@ -625,16 +549,8 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_security_group_rule_update(self):
|
def test_security_group_rule_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_security_group_rule,
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
security_group_rule.SecurityGroupRule)
|
||||||
self.proxy.update_security_group_rule,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[
|
|
||||||
security_group_rule.SecurityGroupRule,
|
|
||||||
"resource_or_id"
|
|
||||||
],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_subnet_create_attrs(self):
|
def test_subnet_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -666,13 +582,7 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_subnet_update(self):
|
def test_subnet_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_subnet, subnet.Subnet)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_subnet,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[subnet.Subnet, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_vpn_service_create_attrs(self):
|
def test_vpn_service_create_attrs(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
@@ -707,11 +617,5 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_vpn_service_update(self):
|
def test_vpn_service_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_vpn_service,
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
vpn_service.VPNService)
|
||||||
self.proxy.update_vpn_service,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[vpn_service.VPNService,
|
|
||||||
"resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|||||||
@@ -66,13 +66,7 @@ class TestTelemetryProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_kwargs={})
|
expected_kwargs={})
|
||||||
|
|
||||||
def test_alarm_update(self):
|
def test_alarm_update(self):
|
||||||
kwargs = {"x": 1, "y": 2, "z": 3}
|
self.verify_update(self.proxy.update_alarm, alarm.Alarm)
|
||||||
self.verify_update2('openstack.proxy.BaseProxy._update',
|
|
||||||
self.proxy.update_alarm,
|
|
||||||
method_args=["resource_or_id"],
|
|
||||||
method_kwargs=kwargs,
|
|
||||||
expected_args=[alarm.Alarm, "resource_or_id"],
|
|
||||||
expected_kwargs=kwargs)
|
|
||||||
|
|
||||||
def test_capability_find(self):
|
def test_capability_find(self):
|
||||||
self.verify_find('openstack.telemetry.v2.capability.Capability.find',
|
self.verify_find('openstack.telemetry.v2.capability.Capability.find',
|
||||||
|
|||||||
@@ -145,12 +145,21 @@ class TestProxyBase(base.TestCase):
|
|||||||
method, expected_result=["result"],
|
method, expected_result=["result"],
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
def verify_update(self, mock_method, test_method, **kwargs):
|
def verify_update(self, test_method, resource_type,
|
||||||
self._verify(mock_method, test_method, expected_result="result",
|
mock_method="openstack.proxy.BaseProxy._update",
|
||||||
**kwargs)
|
expected_result="result", **kwargs):
|
||||||
|
the_kwargs = {"x": 1, "y": 2, "z": 3}
|
||||||
|
method_args = ["resource_or_id"]
|
||||||
|
method_kwargs = the_kwargs
|
||||||
|
expected_args = [resource_type, "resource_or_id"]
|
||||||
|
expected_kwargs = the_kwargs
|
||||||
|
|
||||||
def verify_update2(self, mock_method, test_method, **kwargs):
|
self._verify2(mock_method, test_method,
|
||||||
self._verify2(mock_method, test_method, expected_result="result",
|
expected_result=expected_result,
|
||||||
|
method_args=method_args,
|
||||||
|
method_kwargs=method_kwargs,
|
||||||
|
expected_args=expected_args,
|
||||||
|
expected_kwargs=expected_kwargs,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
def verify_wait_for_status(self, mock_method, test_method, **kwargs):
|
def verify_wait_for_status(self, mock_method, test_method, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user