X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=test%2Flib%2Ftest_utils.py;h=7fcb98076aa0136457e18b79dc0fbcaa6e6b7e84;hb=64fdda7bf665776fb043b355e989502e6c367a0c;hp=19405526bb674599a26b5310789f4bf46bf9d544;hpb=1e2eb157cb569e9c28a5b7888ed97076d27414cb;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