summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-04-14 18:30:07 +0200
committerAndrew Bartlett <abartlet@samba.org>2008-04-14 18:30:07 +0200
commit02f3695897dddb013fc1268a4f1a852cd4a3465e (patch)
tree50a30ab1a90b5f185bcd866c564b57e6fc6de4e9 /source4/scripting/python
parent3170ae538a201f1dfe4b6eb70047a31b344a866b (diff)
downloadsamba-02f3695897dddb013fc1268a4f1a852cd4a3465e.tar.gz
samba-02f3695897dddb013fc1268a4f1a852cd4a3465e.tar.bz2
samba-02f3695897dddb013fc1268a4f1a852cd4a3465e.zip
Add convenience TestCase class for testing RPC interfaces.
(This used to be commit 2f19f981449bf6f4d29f231259817c8b66104a9b)
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/tests/__init__.py7
-rw-r--r--source4/scripting/python/samba/tests/dcerpc/registry.py9
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 c8673d3fae..ceb7dd23f3 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 147acc5098..1afdc582a7 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,