diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-04-14 18:30:07 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-04-14 18:30:07 +0200 |
commit | 02f3695897dddb013fc1268a4f1a852cd4a3465e (patch) | |
tree | 50a30ab1a90b5f185bcd866c564b57e6fc6de4e9 /source4 | |
parent | 3170ae538a201f1dfe4b6eb70047a31b344a866b (diff) | |
download | samba-02f3695897dddb013fc1268a4f1a852cd4a3465e.tar.gz samba-02f3695897dddb013fc1268a4f1a852cd4a3465e.tar.xz samba-02f3695897dddb013fc1268a4f1a852cd4a3465e.zip |
Add convenience TestCase class for testing RPC interfaces.
(This used to be commit 2f19f981449bf6f4d29f231259817c8b66104a9b)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/tests/__init__.py | 7 | ||||
-rw-r--r-- | source4/scripting/python/samba/tests/dcerpc/registry.py | 9 |
2 files changed, 11 insertions, 5 deletions
diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py index c8673d3fae2..ceb7dd23f35 100644 --- a/source4/scripting/python/samba/tests/__init__.py +++ b/source4/scripting/python/samba/tests/__init__.py @@ -90,3 +90,10 @@ def get_loadparm(): lp = param.LoadParm() lp.load(os.getenv("SMB_CONF_PATH")) return lp + +class RpcInterfaceTestCase(unittest.TestCase): + def get_loadparm(self): + return get_loadparm() + + def get_credentials(self): + return None diff --git a/source4/scripting/python/samba/tests/dcerpc/registry.py b/source4/scripting/python/samba/tests/dcerpc/registry.py index 147acc50984..1afdc582a7e 100644 --- a/source4/scripting/python/samba/tests/dcerpc/registry.py +++ b/source4/scripting/python/samba/tests/dcerpc/registry.py @@ -18,14 +18,13 @@ # import winreg -from param import LoadParm import unittest -from samba.tests import get_loadparm +from samba.tests import RpcInterfaceTestCase -class WinregTests(unittest.TestCase): +class WinregTests(RpcInterfaceTestCase): def setUp(self): - lp_ctx = get_loadparm() - self.conn = winreg.winreg("ncalrpc:", lp_ctx) + self.conn = winreg.winreg("ncalrpc:", self.get_loadparm(), + self.get_credentials()) def get_hklm(self): return self.conn.OpenHKLM(None, |