From: Simo Sorce Date: Wed, 18 Mar 2015 00:18:21 +0000 (-0400) Subject: Add negative authentication test X-Git-Tag: v0.5.0~19 X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fipsilon.git;a=commitdiff_plain;h=2b9b1190fdca8dc94d0a7d7f5f00d8084f729127;hp=0b40c36998ed29c7e98a8cf5f42a798e0bec0870 Add negative authentication test Signed-off-by: Simo Sorce Reviewed-by: Nathan Kinder --- diff --git a/tests/test1.py b/tests/test1.py index 34b9c88..8589f38 100755 --- a/tests/test1.py +++ b/tests/test1.py @@ -143,3 +143,13 @@ if __name__ == '__main__': print >> sys.stderr, " ERROR: %s" % repr(e) sys.exit(1) print " SUCCESS" + + print "test1: Try authentication failure ...", + newsess = HttpSessions() + newsess.add_server(idpname, 'http://127.0.0.10:45080', user, 'wrong') + try: + newsess.auth_to_idp(idpname) + print >> sys.stderr, " ERROR: Authentication should have failed" + sys.exit(1) + except Exception, e: # pylint: disable=broad-except + print " SUCCESS"