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

lib/smbconf: add delete_parameter method to SMBConf

Add a delete_parameter method wrapping smbconf_delete_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-25 09:59:36 -04:00
committed by Jeremy Allison
parent 2b6bd70cdc
commit 64a36f5bf0
2 changed files with 48 additions and 0 deletions

View File

@@ -210,6 +210,30 @@ class SMBConfTests(samba.tests.TestCase):
ValueError, sconf.create_set_share, "baz", [("a", "b", "c")]
)
def test_delete_parameter(self):
sconf = self.s3smbconf.init_reg(None)
sconf.drop()
params = [
("path", "/mnt/baz"),
("browseable", "yes"),
("read only", "no"),
]
sconf.create_set_share("baz", params)
self.assertEqual(sconf.get_share("baz"), ("baz", params))
sconf.delete_parameter("baz", "browseable")
self.assertEqual(
sconf.get_share("baz"),
(
"baz",
[
("path", "/mnt/baz"),
("read only", "no"),
],
),
)
if __name__ == "__main__":
import unittest