From f4b8c6f133335544a9ad4500974a096e296d9950 Mon Sep 17 00:00:00 2001 From: Masayuki Igawa Date: Wed, 25 Mar 2015 16:47:28 -0400 Subject: Add a test case for rand_name with prefix This commit adds a test case for rand_name with prefix. Change-Id: If0269d59cf45843cf50f7436df46c063693fb060 --- tempest_lib/tests/common/utils/test_data_utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tempest_lib/tests/common/utils/test_data_utils.py b/tempest_lib/tests/common/utils/test_data_utils.py index 08566f4..fca812e 100644 --- a/tempest_lib/tests/common/utils/test_data_utils.py +++ b/tempest_lib/tests/common/utils/test_data_utils.py @@ -48,6 +48,13 @@ class TestDataUtils(base.TestCase): self.assertTrue(actual.startswith('foo')) self.assertNotEqual(actual, actual2) + def test_rand_name_with_prefix(self): + actual = data_utils.rand_name(prefix='prefix-str') + self.assertIsInstance(actual, str) + self.assertRegexpMatches(actual, "^prefix-str-") + actual2 = data_utils.rand_name(prefix='prefix-str') + self.assertNotEqual(actual, actual2) + def test_rand_url(self): actual = data_utils.rand_url() self.assertIsInstance(actual, str) -- cgit v1.2.1