From 3b738a5914765afad2be30ba3f7db11170e87012 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 26 Feb 2012 20:39:13 +0100 Subject: provision: Add tests for determine_netbios_name. --- source4/scripting/python/samba/tests/provision.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py index 0ebe400405..a96efdf39e 100644 --- a/source4/scripting/python/samba/tests/provision.py +++ b/source4/scripting/python/samba/tests/provision.py @@ -24,6 +24,7 @@ from samba.provision import ( ProvisionNames, ProvisionPaths, ProvisionResult, + determine_netbios_name, sanitize_server_role, setup_secretsdb, findnss, @@ -190,3 +191,11 @@ class ProvisionResultTests(TestCase): self.assertEquals(entries[1], ("INFO", 'Admin password: geheim')) + +class DetermineNetbiosNameTests(TestCase): + + def test_limits_to_15(self): + self.assertEquals("A" * 15, determine_netbios_name("a" * 30)) + + def test_strips_invalid(self): + self.assertEquals("BLABLA", determine_netbios_name("bla/bla")) -- cgit