X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=test%2Flib%2Ftest_utils.py;h=7fcb98076aa0136457e18b79dc0fbcaa6e6b7e84;hb=e0972478442dbd4dbdd9b801d3f67933c9438623;hp=19405526bb674599a26b5310789f4bf46bf9d544;hpb=a3add67b8809f12e8e2acb2d1ea6a74c661b8f36;p=nepi.git diff --git a/test/lib/test_utils.py b/test/lib/test_utils.py index 19405526..7fcb9807 100644 --- a/test/lib/test_utils.py +++ b/test/lib/test_utils.py @@ -122,3 +122,16 @@ def skipIfNotSfaCredentials(func): return wrapped +def skipIfNotSfi(func): + name = func.__name__ + def wrapped(*args, **kwargs): + try: + from sfa.client.sfi import Sfi + from sfa.util.xrn import hrn_to_urn + except ImportError: + print "*** WARNING: Skipping test %s: sfi-client or sfi-common not installed\n" % name + return + + return func(*args, **kwargs) + + return wrapped