summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/scripting/python/samba/tests/__init__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py
index bf7c563c4e..7a5c2aa694 100644
--- a/source4/scripting/python/samba/tests/__init__.py
+++ b/source4/scripting/python/samba/tests/__init__.py
@@ -68,6 +68,17 @@ def env_loadparm():
raise Exception("SMB_CONF_PATH not set")
return lp
+def env_get_var_value(var_name):
+ """Returns value for variable in os.environ
+
+ Function throws AssertionError if variable is defined.
+ Unit-test based python tests require certain input params
+ to be set in environment, otherwise they can't be run
+ """
+ assert var_name in os.environ.keys(), "Please supply %s in environment" % var_name
+ return os.environ[var_name]
+
+
cmdline_credentials = None
class RpcInterfaceTestCase(TestCase):