# License for the specific language governing permissions and limitations
# under the License.
-import random
-
import mock
+import uuid
+
from oslo_config import cfg
from neutron import context
meh_quota_flag = 'quota_meh'
meh_quota_opts = [cfg.IntOpt(meh_quota_flag, default=99)]
-random.seed()
class TestResource(base.DietTestCase):
session = db_api.get_session()
with session.begin():
tenant_id = tenant_id or self.tenant_id
- session.add(test_quota.MehModel(
- meh='meh_%d' % random.randint(0, 10000),
- tenant_id=tenant_id))
- session.add(test_quota.MehModel(
- meh='meh_%d' % random.randint(0, 10000),
- tenant_id=tenant_id))
+ session.add(test_quota.MehModel(meh='meh_%s' % uuid.uuid4(),
+ tenant_id=tenant_id))
+ session.add(test_quota.MehModel(meh='meh_%s' % uuid.uuid4(),
+ tenant_id=tenant_id))
def _delete_data(self):
session = db_api.get_session()
self.test_set_tracked_resource_new_resource()
self.registry.set_tracked_resource('meh', test_quota.OtherMehModel,
override=True)
- # Overidde is set to True, the model class should change
+ # Override is set to True, the model class should change
self.assertEqual(test_quota.OtherMehModel,
self.registry._tracked_resource_mappings['meh'])
def test_set_tracked_resource_existing_no_override(self):
self.test_set_tracked_resource_new_resource()
self.registry.set_tracked_resource('meh', test_quota.OtherMehModel)
- # Overidde is set to false, the model class should not change
+ # Override is set to false, the model class should not change
self.assertEqual(test_quota.MehModel,
self.registry._tracked_resource_mappings['meh'])