diff options
author | Masayuki Igawa <mas-igawa@ut.jp.nec.com> | 2015-03-25 16:47:28 -0400 |
---|---|---|
committer | Masayuki Igawa <mas-igawa@ut.jp.nec.com> | 2015-03-25 16:47:28 -0400 |
commit | f4b8c6f133335544a9ad4500974a096e296d9950 (patch) | |
tree | 2ffbc65dd68342afcc0ff711fcffeda69c82279c | |
parent | 32369dbbf62119215d58d0b557f2ba0e170ebb93 (diff) | |
download | tempest-lib-f4b8c6f133335544a9ad4500974a096e296d9950.tar.gz |
Add a test case for rand_name with prefix
This commit adds a test case for rand_name with prefix.
Change-Id: If0269d59cf45843cf50f7436df46c063693fb060
-rw-r--r-- | tempest_lib/tests/common/utils/test_data_utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
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) |