summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-02-26 15:56:52 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-02-26 16:27:06 +0100
commit3e6fa054f9567c8ba741969c6961d7f0eda5c1ca (patch)
treeb9737b80d09fd684631934ab8046ecc17f33fa60 /source4/scripting/python
parent21f443eb8286805dde6bbb1b8f37379f6e0aa203 (diff)
downloadsamba-3e6fa054f9567c8ba741969c6961d7f0eda5c1ca.tar.gz
samba-3e6fa054f9567c8ba741969c6961d7f0eda5c1ca.tar.bz2
samba-3e6fa054f9567c8ba741969c6961d7f0eda5c1ca.zip
provision/tests: Test for phpldapadminconfig path.
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/provision/__init__.py2
-rw-r--r--source4/scripting/python/samba/tests/provision.py24
2 files changed, 22 insertions, 4 deletions
diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py
index 526c07a37c..f92ee67be5 100644
--- a/source4/scripting/python/samba/provision/__init__.py
+++ b/source4/scripting/python/samba/provision/__init__.py
@@ -388,7 +388,7 @@ class ProvisionResult(object):
if self.paths.phpldapadminconfig is not None:
logger.info(
- "A phpLDAPadmin configuration file suitable for administering the Samba 4 LDAP server has been created in %s .",
+ "A phpLDAPadmin configuration file suitable for administering the Samba 4 LDAP server has been created in %s.",
self.paths.phpldapadminconfig)
diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py
index 937221407e..40665c01f4 100644
--- a/source4/scripting/python/samba/tests/provision.py
+++ b/source4/scripting/python/samba/tests/provision.py
@@ -147,8 +147,12 @@ class DummyLogger(object):
class ProvisionResultTests(TestCase):
- def test_report_logger(self):
+ def report_logger(self, result):
logger = DummyLogger()
+ result.report_logger(logger)
+ return logger.entries
+
+ def test_basic_report_logger(self):
result = ProvisionResult()
result.server_role = "domain controller"
result.names = ProvisionNames()
@@ -157,10 +161,24 @@ class ProvisionResultTests(TestCase):
result.names.dnsdomain = "dnsdomein"
result.domainsid = "S1-1-1"
result.paths = ProvisionPaths()
- result.report_logger(logger)
- self.assertEquals(logger.entries, [
+ entries = self.report_logger(result)
+ self.assertEquals(entries, [
('INFO', 'Server Role: domain controller'),
('INFO', 'Hostname: hostnaam'),
('INFO', 'NetBIOS Domain: DOMEIN'),
('INFO', 'DNS Domain: dnsdomein'),
('INFO', 'DOMAIN SID: S1-1-1')])
+
+ def test_report_logger_phpldapadmin(self):
+ result = ProvisionResult()
+ result.server_role = "domain controller"
+ result.names = ProvisionNames()
+ result.names.hostname = "hostnaam"
+ result.names.domain = "DOMEIN"
+ result.names.dnsdomain = "dnsdomein"
+ result.domainsid = "S1-1-1"
+ result.paths = ProvisionPaths()
+ result.paths.phpldapadminconfig = "/some/ldapconfig"
+ entries = self.report_logger(result)
+ self.assertEquals(entries[-1],
+ ("INFO", "A phpLDAPadmin configuration file suitable for administering the Samba 4 LDAP server has been created in /some/ldapconfig."))