本文整理汇总了Python中pulp.common.bundle.Bundle.uid方法的典型用法代码示例。如果您正苦于以下问题:Python Bundle.uid方法的具体用法?Python Bundle.uid怎么用?Python Bundle.uid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp.common.bundle.Bundle
的用法示例。
在下文中一共展示了Bundle.uid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_uid_invalid_certificate
# 需要导入模块: from pulp.common.bundle import Bundle [as 别名]
# 或者: from pulp.common.bundle.Bundle import uid [as 别名]
def test_uid_invalid_certificate(self, fake_read, fake_valid):
fake_read.return_value = CERTIFICATE
fake_valid.return_value = False
bundle = Bundle('')
uid = bundle.uid()
fake_valid.assert_called_with()
self.assertTrue(uid is None)
示例2: test_uid
# 需要导入模块: from pulp.common.bundle import Bundle [as 别名]
# 或者: from pulp.common.bundle.Bundle import uid [as 别名]
def test_uid(self, fake_read, fake_valid):
fake_read.return_value = VERIZON_CERTIFICATE
fake_valid.return_value = True
bundle = Bundle('')
uid = bundle.uid()
fake_valid.assert_called_with()
fake_read.assert_called_with()
self.assertEqual(uid, 'vzn-user')
示例3: uid
# 需要导入模块: from pulp.common.bundle import Bundle [as 别名]
# 或者: from pulp.common.bundle.Bundle import uid [as 别名]
def uid(self):
"""
Get the userid (UID) part of the certificate subject.
Returns None, if the certificate is invalid.
:return The userid (UID) part of the certificate subject or None when
the certificate is not found or invalid.
:rtype: str
"""
try:
return Bundle.uid(self)
except X509Error:
log.warn('certificate: %s, not valid', self.path)