]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Replace occurences of 'test_tenant' with 'test-tenant' in tests
authorAssaf Muller <amuller@redhat.com>
Sat, 3 May 2014 14:05:04 +0000 (17:05 +0300)
committerAssaf Muller <amuller@redhat.com>
Mon, 30 Jun 2014 11:05:53 +0000 (14:05 +0300)
tenant_id will now be consistent among all resources created.
This is important when getting or listing resources by tenant_id.
Most resources are created under the 'test-tenant', while
metering and security groups were created under 'test_tenant'.

Closes-Bug: #1335821
Change-Id: Ifde22814ab5c302e751f2102f6fd7ef52c932126

neutron/tests/unit/db/metering/test_db_metering.py
neutron/tests/unit/test_extension_security_group.py

index 8a03509c30ea1d7a8feddb38f78d234d34165235..05fe57ef2912a25a2528ad62b77d6ae9c675a10a 100644 (file)
@@ -43,7 +43,7 @@ class MeteringPluginDbTestCaseMixin(object):
     def _create_metering_label(self, fmt, name, description, **kwargs):
         data = {'metering_label': {'name': name,
                                    'tenant_id': kwargs.get('tenant_id',
-                                                           'test_tenant'),
+                                                           'test-tenant'),
                                    'description': description}}
         req = self.new_create_request('metering-labels', data,
                                       fmt)
@@ -66,7 +66,7 @@ class MeteringPluginDbTestCaseMixin(object):
                                     remote_ip_prefix, excluded, **kwargs):
         data = {'metering_label_rule':
                 {'metering_label_id': metering_label_id,
-                 'tenant_id': kwargs.get('tenant_id', 'test_tenant'),
+                 'tenant_id': kwargs.get('tenant_id', 'test-tenant'),
                  'direction': direction,
                  'excluded': excluded,
                  'remote_ip_prefix': remote_ip_prefix}}
index 4a38f6da2f11f4d48fff6a848790feac3847bced..7b619c5054ef5368260c7cfdcb5e92d8fd0d6b66 100644 (file)
@@ -56,7 +56,7 @@ class SecurityGroupsTestCase(test_db_plugin.NeutronDbPluginV2TestCase):
 
         data = {'security_group': {'name': name,
                                    'tenant_id': kwargs.get('tenant_id',
-                                                           'test_tenant'),
+                                                           'test-tenant'),
                                    'description': description}}
         security_group_req = self.new_create_request('security-groups', data,
                                                      fmt)
@@ -69,7 +69,7 @@ class SecurityGroupsTestCase(test_db_plugin.NeutronDbPluginV2TestCase):
     def _build_security_group_rule(self, security_group_id, direction, proto,
                                    port_range_min=None, port_range_max=None,
                                    remote_ip_prefix=None, remote_group_id=None,
-                                   tenant_id='test_tenant',
+                                   tenant_id='test-tenant',
                                    ethertype=const.IPv4):
 
         data = {'security_group_rule': {'security_group_id': security_group_id,
@@ -1243,7 +1243,7 @@ class TestSecurityGroups(SecurityGroupDBTestCase):
             rule = {'security_group_id': sg['security_group']['id'],
                     'direction': 'ingress',
                     'ethertype': 'IPv4',
-                    'tenant_id': 'test_tenant'}
+                    'tenant_id': 'test-tenant'}
 
             res = self._create_security_group_rule(
                 self.fmt, {'security_group_rule': rule})
@@ -1258,11 +1258,11 @@ class TestSecurityGroups(SecurityGroupDBTestCase):
             rule_v4 = {'security_group_id': sg['security_group']['id'],
                        'direction': 'ingress',
                        'ethertype': 'IPv4',
-                       'tenant_id': 'test_tenant'}
+                       'tenant_id': 'test-tenant'}
             rule_v6 = {'security_group_id': sg['security_group']['id'],
                        'direction': 'ingress',
                        'ethertype': 'IPv6',
-                       'tenant_id': 'test_tenant'}
+                       'tenant_id': 'test-tenant'}
 
             rules = {'security_group_rules': [rule_v4, rule_v6]}
             res = self._create_security_group_rule(self.fmt, rules)