summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-04-05 23:17:43 +0200
committerJelmer Vernooij <jelmer@samba.org>2009-04-06 00:25:03 +0200
commitb1db78c595ca7b171eeb141428e963431163cddb (patch)
treeafba1d99422d232848f62b77b340ae1f189e48d3 /source4/scripting/python/samba/tests
parent15f6d5e805490b35ed390f731944bc4ac4e3327b (diff)
downloadsamba-b1db78c595ca7b171eeb141428e963431163cddb.tar.gz
samba-b1db78c595ca7b171eeb141428e963431163cddb.tar.xz
samba-b1db78c595ca7b171eeb141428e963431163cddb.zip
Make valid_netbios_name() check a bit stricter.
Diffstat (limited to 'source4/scripting/python/samba/tests')
-rw-r--r--source4/scripting/python/samba/tests/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py
index b342b93c49..524c3a3b91 100644
--- a/source4/scripting/python/samba/tests/__init__.py
+++ b/source4/scripting/python/samba/tests/__init__.py
@@ -96,3 +96,15 @@ class RpcInterfaceTestCase(unittest.TestCase):
def get_credentials(self):
return cmdline_credentials
+
+
+class ValidNetbiosNameTests(unittest.TestCase):
+
+ def test_valid(self):
+ self.assertTrue(valid_netbios_name("FOO"))
+
+ def test_too_long(self):
+ self.assertFalse(valid_netbios_name("FOO"*10))
+
+ def test_invalid_characters(self):
+ self.assertFalse(valid_netbios_name("()BLA"))