mirror of
https://github.com/samba-team/samba.git
synced 2025-07-16 20:59:12 +03:00
Add convenience TestCase class for testing RPC interfaces.
(This used to be commit 2f19f98144
)
This commit is contained in:
committed by
Andrew Bartlett
parent
3170ae538a
commit
02f3695897
@ -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
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user