本文整理汇总了Python中appscale.tools.local_state.LocalState.obscure_dict方法的典型用法代码示例。如果您正苦于以下问题:Python LocalState.obscure_dict方法的具体用法?Python LocalState.obscure_dict怎么用?Python LocalState.obscure_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类appscale.tools.local_state.LocalState
的用法示例。
在下文中一共展示了LocalState.obscure_dict方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_obscure_dict
# 需要导入模块: from appscale.tools.local_state import LocalState [as 别名]
# 或者: from appscale.tools.local_state.LocalState import obscure_dict [as 别名]
def test_obscure_dict(self):
# make sure that EC2 credentials get filtered correctly
creds = {
'ec2_access_key' : 'ABCDEFG',
'ec2_secret_key' : 'HIJKLMN',
'CLOUD_EC2_ACCESS_KEY' : 'OPQRSTU',
'CLOUD_EC2_SECRET_KEY' : 'VWXYZAB'
}
expected = {
'ec2_access_key' : '***DEFG',
'ec2_secret_key' : '***KLMN',
'CLOUD_EC2_ACCESS_KEY' : '***RSTU',
'CLOUD_EC2_SECRET_KEY' : '***YZAB'
}
actual = LocalState.obscure_dict(creds)
self.assertEquals(expected['ec2_access_key'], actual['ec2_access_key'])
self.assertEquals(expected['ec2_secret_key'], actual['ec2_secret_key'])
self.assertEquals(expected['CLOUD_EC2_ACCESS_KEY'],
actual['CLOUD_EC2_ACCESS_KEY'])
self.assertEquals(expected['CLOUD_EC2_SECRET_KEY'],
actual['CLOUD_EC2_SECRET_KEY'])