def test_password_hiding(self): """errorlib - hide password in frame analysis""" try: password = '******' int('foo') except: output = get_pretty_traceback(exc_info=sys.exc_info()) self.failIf(password in output, output) self.failUnless('<*****>' in output, output)
def test_dbquery_password_hiding(self): """errorlib - hide dbquery password in frame analysis""" from invenio.legacy.dbquery import connect kwargs = {'host': 'foo', 'port': 999, 'db': 'baz', 'user': '******', 'passwd': '123', 'use_unicode': False, 'charset': 'utf8'} try: connect(**kwargs) except: output = get_pretty_traceback(exc_info=sys.exc_info()) self.failIf('123' in output, output) self.failUnless('<*****>' in output, output)
def test_nested_password_hiding(self): """errorlib - hide password nested in dictionary in frame analysis""" try: foo = { 'bar' : 'baz', 'qoox' : { 'blibpwdblob' : '1234' } } int(foo) except: output = get_pretty_traceback(exc_info=sys.exc_info()) self.failIf('1234' in output, output) self.failUnless('<*****>' in output, output)