mirror of
https://github.com/samba-team/samba.git
synced 2025-12-06 16:23:49 +03:00
pytests: slightly better errors in Testcase.insta_creds()
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
e5a099482d
commit
a047e71bc7
@@ -113,10 +113,11 @@ class TestCase(unittest.TestCase):
|
||||
def insta_creds(self, template=None, username=None, userpass=None, kerberos_state=None):
|
||||
|
||||
if template is None:
|
||||
assert template is not None
|
||||
raise ValueError("you need to supply a Credentials template")
|
||||
|
||||
if username is not None:
|
||||
assert userpass is not None
|
||||
if username is not None and userpass is None:
|
||||
raise ValueError(
|
||||
"you cannot set creds username without setting a password")
|
||||
|
||||
if username is None:
|
||||
assert userpass is None
|
||||
|
||||
Reference in New Issue
Block a user