Merge "Replaces uuid.uuid4 with uuidutils.generate_uuid()"
This commit is contained in:
commit
31e9b0d476
@ -14,7 +14,6 @@
|
||||
# limitations under the License.
|
||||
|
||||
import ddt
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
|
||||
@ -23,6 +22,8 @@ from distilclient import exceptions
|
||||
from distilclient.tests.unit import utils
|
||||
from distilclient.v2 import client
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class ClientTest(utils.TestCase):
|
||||
@ -37,7 +38,7 @@ class ClientTest(utils.TestCase):
|
||||
def test_adapter_properties(self):
|
||||
# sample of properties, there are many more
|
||||
retries = 3
|
||||
base_url = uuid.uuid4().hex
|
||||
base_url = uuidutils.generate_uuid()
|
||||
|
||||
s = client.session.Session()
|
||||
c = client.Client(session=s,
|
||||
@ -55,7 +56,7 @@ class ClientTest(utils.TestCase):
|
||||
|
||||
def test_auth_via_token_and_session(self):
|
||||
s = client.session.Session()
|
||||
base_url = uuid.uuid4().hex
|
||||
base_url = uuidutils.generate_uuid()
|
||||
c = client.Client(input_auth_token='token',
|
||||
distil_url=base_url, session=s,
|
||||
api_version=distilclient.API_MAX_VERSION)
|
||||
@ -64,7 +65,7 @@ class ClientTest(utils.TestCase):
|
||||
self.assertIsNone(c.keystone_client)
|
||||
|
||||
def test_auth_via_token(self):
|
||||
base_url = uuid.uuid4().hex
|
||||
base_url = uuidutils.generate_uuid()
|
||||
|
||||
c = client.Client(input_auth_token='token',
|
||||
distil_url=base_url,
|
||||
|
@ -14,13 +14,14 @@
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
import uuid
|
||||
|
||||
import distilclient
|
||||
from distilclient import base
|
||||
from distilclient.tests.unit import utils
|
||||
from distilclient.v2 import client
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
||||
class InvoicesTest(utils.TestCase):
|
||||
|
||||
@ -28,7 +29,8 @@ class InvoicesTest(utils.TestCase):
|
||||
super(InvoicesTest, self).setUp()
|
||||
self.client = client.Client(session=client.session.Session(),
|
||||
api_version=distilclient.API_MAX_VERSION,
|
||||
distil_url=uuid.uuid4().hex, retries=3,
|
||||
distil_url=uuidutils.generate_uuid(),
|
||||
retries=3,
|
||||
input_auth_token='token')
|
||||
|
||||
@mock.patch.object(base.Manager, '_list')
|
||||
|
@ -14,13 +14,14 @@
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
import uuid
|
||||
|
||||
import distilclient
|
||||
from distilclient import base
|
||||
from distilclient.tests.unit import utils
|
||||
from distilclient.v2 import client
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
||||
class HealthTest(utils.TestCase):
|
||||
|
||||
@ -28,7 +29,8 @@ class HealthTest(utils.TestCase):
|
||||
super(HealthTest, self).setUp()
|
||||
self.client = client.Client(session=client.session.Session(),
|
||||
api_version=distilclient.API_MAX_VERSION,
|
||||
distil_url=uuid.uuid4().hex, retries=3,
|
||||
distil_url=uuidutils.generate_uuid(),
|
||||
retries=3,
|
||||
input_auth_token='token')
|
||||
|
||||
@mock.patch.object(base.Manager, '_list')
|
||||
|
@ -14,13 +14,14 @@
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
import uuid
|
||||
|
||||
import distilclient
|
||||
from distilclient import base
|
||||
from distilclient.tests.unit import utils
|
||||
from distilclient.v2 import client
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
||||
class InvoicesTest(utils.TestCase):
|
||||
|
||||
@ -28,7 +29,8 @@ class InvoicesTest(utils.TestCase):
|
||||
super(InvoicesTest, self).setUp()
|
||||
self.client = client.Client(session=client.session.Session(),
|
||||
api_version=distilclient.API_MAX_VERSION,
|
||||
distil_url=uuid.uuid4().hex, retries=3,
|
||||
distil_url=uuidutils.generate_uuid(),
|
||||
retries=3,
|
||||
input_auth_token='token')
|
||||
|
||||
@mock.patch.object(base.Manager, '_list')
|
||||
|
@ -14,13 +14,14 @@
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
import uuid
|
||||
|
||||
import distilclient
|
||||
from distilclient import base
|
||||
from distilclient.tests.unit import utils
|
||||
from distilclient.v2 import client
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
||||
class MeasurementsTest(utils.TestCase):
|
||||
|
||||
@ -29,7 +30,8 @@ class MeasurementsTest(utils.TestCase):
|
||||
|
||||
self.client = client.Client(session=client.session.Session(),
|
||||
api_version=distilclient.API_MAX_VERSION,
|
||||
distil_url=uuid.uuid4().hex, retries=3,
|
||||
distil_url=uuidutils.generate_uuid(),
|
||||
retries=3,
|
||||
input_auth_token='token')
|
||||
|
||||
@mock.patch.object(base.Manager, '_list')
|
||||
|
@ -14,13 +14,14 @@
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
import uuid
|
||||
|
||||
import distilclient
|
||||
from distilclient import base
|
||||
from distilclient.tests.unit import utils
|
||||
from distilclient.v2 import client
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
||||
class ProductsTest(utils.TestCase):
|
||||
|
||||
@ -28,7 +29,8 @@ class ProductsTest(utils.TestCase):
|
||||
super(ProductsTest, self).setUp()
|
||||
self.client = client.Client(session=client.session.Session(),
|
||||
api_version=distilclient.API_MAX_VERSION,
|
||||
distil_url=uuid.uuid4().hex, retries=3,
|
||||
distil_url=uuidutils.generate_uuid(),
|
||||
retries=3,
|
||||
input_auth_token='token')
|
||||
|
||||
@mock.patch.object(base.Manager, '_list')
|
||||
|
@ -14,13 +14,14 @@
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
import uuid
|
||||
|
||||
import distilclient
|
||||
from distilclient import base
|
||||
from distilclient.tests.unit import utils
|
||||
from distilclient.v2 import client
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
|
||||
class QuotationsTest(utils.TestCase):
|
||||
|
||||
@ -28,7 +29,8 @@ class QuotationsTest(utils.TestCase):
|
||||
super(QuotationsTest, self).setUp()
|
||||
self.client = client.Client(session=client.session.Session(),
|
||||
api_version=distilclient.API_MAX_VERSION,
|
||||
distil_url=uuid.uuid4().hex, retries=3,
|
||||
distil_url=uuidutils.generate_uuid(),
|
||||
retries=3,
|
||||
input_auth_token='token')
|
||||
|
||||
@mock.patch.object(base.Manager, '_list')
|
||||
|
Loading…
x
Reference in New Issue
Block a user