tests/OBSLocal: provide randomString() for ensuring tools not name dependent.

This commit is contained in:
Jimmy Berry 2019-11-01 14:48:15 -05:00
parent e7d8c9857e
commit 5a5d60b5f6

View File

@ -158,6 +158,13 @@ class TestCase(unittest.TestCase):
if comment:
self.assertEqual(review.comment, comment)
def randomString(self, prefix='', length=None):
if prefix and not prefix.endswith('_'):
prefix += '_'
if not length:
length = random.randint(10, 30)
return prefix + ''.join([random.choice(string.ascii_letters) for i in range(length)])
class StagingWorkflow(object):
def __init__(self, project=PROJECT):