diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2012-02-26 15:56:52 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2012-02-26 16:27:06 +0100 |
commit | 3e6fa054f9567c8ba741969c6961d7f0eda5c1ca (patch) | |
tree | b9737b80d09fd684631934ab8046ecc17f33fa60 | |
parent | 21f443eb8286805dde6bbb1b8f37379f6e0aa203 (diff) | |
download | samba-3e6fa054f9567c8ba741969c6961d7f0eda5c1ca.tar.gz samba-3e6fa054f9567c8ba741969c6961d7f0eda5c1ca.tar.bz2 samba-3e6fa054f9567c8ba741969c6961d7f0eda5c1ca.zip |
provision/tests: Test for phpldapadminconfig path.
-rw-r--r-- | source4/scripting/python/samba/provision/__init__.py | 2 | ||||
-rw-r--r-- | source4/scripting/python/samba/tests/provision.py | 24 |
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.")) |