1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

python-libnet: Use new NTSTATUSError, WERRORError and DsExtendedError exceptions

This will allow callers to catch specific errors rather than RuntimeException

As this slightly changes the exception, the timecmd test must be updated.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12398
This commit is contained in:
Andrew Bartlett
2016-11-01 12:38:48 +13:00
committed by Garming Sam
parent e51256c7d5
commit 2a49c74519
2 changed files with 103 additions and 15 deletions

View File

@ -39,5 +39,5 @@ class TimeCmdTestCase(SambaToolCmdTest):
"""Run time against a non-existent server, and make sure it fails"""
(result, out, err) = self.runcmd("time", "notaserver")
self.assertEquals(result, -1, "check for result code")
self.assertTrue(err.strip().endswith("NT_STATUS_OBJECT_NAME_NOT_FOUND"), "ensure right error string")
self.assertNotEqual(err.strip().find("NT_STATUS_OBJECT_NAME_NOT_FOUND"), -1, "ensure right error string")
self.assertEquals(out, "", "ensure no output returned")