mirror of
https://github.com/samba-team/samba.git
synced 2025-12-12 12:23:50 +03:00
lib/smbconf: add create_share method to SMBConf
Add a create_share method wrapping smbconf_create_share. 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:
committed by
Jeremy Allison
parent
67807a642a
commit
eb84f67e80
@@ -129,6 +129,16 @@ class SMBConfTests(samba.tests.TestCase):
|
||||
sconf = self.s3smbconf.init(f"file:{self.example_conf_default}")
|
||||
self.assertFalse(sconf.is_writeable())
|
||||
|
||||
def test_create_share(self):
|
||||
sconf = self.s3smbconf.init_reg(None)
|
||||
sconf.create_share("alice")
|
||||
sconf.create_share("bob")
|
||||
names = sconf.share_names()
|
||||
self.assertEqual(names, ["alice", "bob"])
|
||||
self.assertRaises(
|
||||
self.smbconf.SMBConfError, sconf.create_share, "alice"
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import unittest
|
||||
|
||||
Reference in New Issue
Block a user