diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2019-04-18 13:37:27 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-05-01 05:32:25 +0000 |
commit | a047e71bc7daea3855fc786c0e1c9d09878bba5f (patch) | |
tree | e1d32d27dcb9c55b4e5a17ffbe07899ba4a28c91 /python/samba | |
parent | e5a099482d9ad17913065351f8c3d02a2b48c03d (diff) | |
download | samba-a047e71bc7daea3855fc786c0e1c9d09878bba5f.tar.gz |
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>
Diffstat (limited to 'python/samba')
-rw-r--r-- | python/samba/tests/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py index f904499b90b..cbd164de1f9 100644 --- a/python/samba/tests/__init__.py +++ b/python/samba/tests/__init__.py @@ -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 |