Adam Litke has uploaded a new change for review.
Change subject: tests: Add gen_uuid test helper ......................................................................
tests: Add gen_uuid test helper
The test code is sprinkled with lots of boilerplate code to generate UUIDs in the proper format. Add a helper to testlib so we can reduce this duplicated logic in tests.
Change-Id: I622928911c3f07739fd61f61a58cee2e692c7eeb Signed-off-by: Adam Litke alitke@redhat.com --- M tests/testlib.py 1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/64542/1
diff --git a/tests/testlib.py b/tests/testlib.py index c341c24..b75e7a2 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -28,6 +28,7 @@ import pickle import platform import unittest +import uuid from functools import wraps import shutil import sys @@ -588,3 +589,10 @@ """ while job.active: time.sleep(1) + + +def gen_uuid(): + """ + Return a new UUID in the format used for all vdsm APIs that accept UUIDs. + """ + return str(uuid.uuid4())