1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-17 04:23:50 +03:00

lib/smbconf: add set_parameter method to SMBConf

Add a set_parameter method wrapping smbconf_set_parameter.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
John Mulligan
2022-04-24 10:18:42 -04:00
committed by Jeremy Allison
parent ff603de514
commit 565d8ae8cd
2 changed files with 38 additions and 0 deletions

View File

@@ -148,6 +148,18 @@ class SMBConfTests(samba.tests.TestCase):
names = sconf.share_names()
self.assertEqual(names, [])
def test_set_parameter(self):
sconf = self.s3smbconf.init_reg(None)
sconf.drop()
sconf.create_share("foobar")
sconf.set_parameter("foobar", "path", "/mnt/foobar")
sconf.set_parameter("foobar", "browseable", "no")
s1 = sconf.get_share("foobar")
self.assertEqual(
s1, ("foobar", [("path", "/mnt/foobar"), ("browseable", "no")])
)
if __name__ == "__main__":
import unittest