mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
py3_tests/kcc : test_verify can hit KCCError as well as GraphError
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
204bd0e447
commit
30e9c00f2d
@ -78,22 +78,13 @@ class KCCTests(samba.tests.TestCase):
|
||||
my_kcc = kcc.KCC(unix_now, readonly=True, verify=True,
|
||||
debug=False, dot_file_dir=None)
|
||||
|
||||
#
|
||||
# The following seems to raise
|
||||
# samba.kcc.graph_utils.GraphError when something
|
||||
# goes wrong.
|
||||
#
|
||||
# Typically failureException is exceptions.AssertionError
|
||||
# by default, see pydoc unittest.TestCase
|
||||
#
|
||||
# As this is flapping under python3, we need to
|
||||
# make sure it generates a failure instead of an error.
|
||||
#
|
||||
# We need to make sure samba.kcc.graph_utils.GraphError
|
||||
# will generate a failure from here on.
|
||||
#
|
||||
self.failureException = samba.kcc.graph_utils.GraphError
|
||||
|
||||
my_kcc.run("ldap://%s" % os.environ["SERVER"],
|
||||
self.lp, self.creds,
|
||||
attempt_live_connections=False)
|
||||
# As this is flapping with errors under python3, we catch
|
||||
# exceptions and turn them into failures..
|
||||
try:
|
||||
my_kcc.run("ldap://%s" % os.environ["SERVER"],
|
||||
self.lp, self.creds,
|
||||
attempt_live_connections=False)
|
||||
except (samba.kcc.graph_utils.GraphError, kcc.KCCError):
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
self.fail()
|
||||
|
Loading…
Reference in New Issue
Block a user