summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-18 18:54:19 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:51:50 +0100
commit4e6ab64762477c0117aa823fd8e6b1275d63e0d7 (patch)
treedb03788ae18b6d5ead8472ba4f6cc8f1b1555106 /source4/scripting/python/samba/tests
parent80529722e30d087bf9a18e239d0ef4e35865c49f (diff)
downloadsamba-4e6ab64762477c0117aa823fd8e6b1275d63e0d7.tar.gz
samba-4e6ab64762477c0117aa823fd8e6b1275d63e0d7.tar.xz
samba-4e6ab64762477c0117aa823fd8e6b1275d63e0d7.zip
r26527: Start on tests for provision.
(This used to be commit 84ac6c6bbfc4baaf28906ee5826a9cf888043656)
Diffstat (limited to 'source4/scripting/python/samba/tests')
-rw-r--r--source4/scripting/python/samba/tests/__init__.py17
-rw-r--r--source4/scripting/python/samba/tests/provision.py59
2 files changed, 76 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py
index d3930e217aa..08084699072 100644
--- a/source4/scripting/python/samba/tests/__init__.py
+++ b/source4/scripting/python/samba/tests/__init__.py
@@ -35,3 +35,20 @@ class LdbTestCase(unittest.TestCase):
self.ldb = samba.Ldb(self.filename)
+class SubstituteVarTestCase(unittest.TestCase):
+ def test_empty(self):
+ self.assertEquals("", samba.substitute_var("", {}))
+
+ def test_nothing(self):
+ self.assertEquals("foo bar", samba.substitute_var("foo bar", {"bar": "bla"}))
+
+ def test_replace(self):
+ self.assertEquals("foo bla", samba.substitute_var("foo ${bar}", {"bar": "bla"}))
+
+ def test_broken(self):
+ self.assertEquals("foo ${bdkjfhsdkfh sdkfh ",
+ samba.substitute_var("foo ${bdkjfhsdkfh sdkfh ", {"bar": "bla"}))
+
+ def test_unknown_var(self):
+ self.assertEquals("foo ${bla} gsff",
+ samba.substitute_var("foo ${bla} gsff", {"bar": "bla"}))
diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py
new file mode 100644
index 00000000000..5edfe79084a
--- /dev/null
+++ b/source4/scripting/python/samba/tests/provision.py
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+
+# Unix SMB/CIFS implementation.
+# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+import unittest
+import samba.provision
+
+class ProvisionTestCase(unittest.TestCase):
+ def test_setup_secretsdb(self):
+ raise NotImplementedError(self.test_setup_secretsdb)
+
+ def test_setup_templatesdb(self):
+ raise NotImplementedError(self.test_setup_templatesdb)
+
+ def test_setup_registry(self):
+ raise NotImplementedError(self.test_setup_registry)
+
+ def test_setup_samdb_rootdse(self):
+ raise NotImplementedError(self.test_setup_samdb_rootdse)
+
+ def test_setup_samdb_partitions(self):
+ raise NotImplementedError(self.test_setup_samdb_partitions)
+
+ def test_create_phpldapadmin_config(self):
+ raise NotImplementedError(self.test_create_phpldapadmin_config)
+
+ def test_provision_dns(self):
+ raise NotImplementedError(self.test_provision_dns)
+
+ def test_provision_ldapbase(self):
+ raise NotImplementedError(self.test_provision_ldapbase)
+
+ def test_provision_guess(self):
+ raise NotImplementedError(self.test_provision_guess)
+
+ def test_join_domain(self):
+ raise NotImplementedError(self.test_join_domain)
+
+ def test_vampire(self):
+ raise NotImplementedError(self.test_vampire)
+
+ def test_erase_partitions(self):
+ raise NotImplementedError(self.test_erase_partitions)
+