Adding doc strings and tests
[nepi.git] / test / lib / test_utils.py
index 1940552..7fcb980 100644 (file)
@@ -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