From 99965558759183a9a0519f100bb7ebdb0099b3b5 Mon Sep 17 00:00:00 2001 From: guo yunxian Date: Fri, 29 Jul 2016 10:06:52 +0800 Subject: [PATCH] Do not use $ in regex $ has been deleted in password, so it also needs to be deleted in regex. Associated Change-Id: Iebb211165c4deee09d34e19b5557a3e086add05a review link: https://review.openstack.org/#/c/346800/ Change-Id: I4e3196c26d81cf359686537d02550434b0b0e559 --- tempest/tests/lib/common/utils/test_data_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tempest/tests/lib/common/utils/test_data_utils.py b/tempest/tests/lib/common/utils/test_data_utils.py index 399c4afc1c..94a4847782 100644 --- a/tempest/tests/lib/common/utils/test_data_utils.py +++ b/tempest/tests/lib/common/utils/test_data_utils.py @@ -59,7 +59,7 @@ class TestDataUtils(base.TestCase): def test_rand_password(self): actual = data_utils.rand_password() self.assertIsInstance(actual, str) - self.assertRegex(actual, "[A-Za-z0-9~!@#$%^&*_=+]{15,}") + self.assertRegex(actual, "[A-Za-z0-9~!@#%^&*_=+]{15,}") actual2 = data_utils.rand_password() self.assertNotEqual(actual, actual2) @@ -67,7 +67,7 @@ class TestDataUtils(base.TestCase): actual = data_utils.rand_password(8) self.assertIsInstance(actual, str) self.assertEqual(len(actual), 8) - self.assertRegex(actual, "[A-Za-z0-9~!@#$%^&*_=+]{8}") + self.assertRegex(actual, "[A-Za-z0-9~!@#%^&*_=+]{8}") actual2 = data_utils.rand_password(8) self.assertNotEqual(actual, actual2) @@ -75,7 +75,7 @@ class TestDataUtils(base.TestCase): actual = data_utils.rand_password(2) self.assertIsInstance(actual, str) self.assertEqual(len(actual), 3) - self.assertRegex(actual, "[A-Za-z0-9~!@#$%^&*_=+]{3}") + self.assertRegex(actual, "[A-Za-z0-9~!@#%^&*_=+]{3}") actual2 = data_utils.rand_password(2) self.assertNotEqual(actual, actual2)