本文整理汇总了Python中kmip.services.kmip_client.KMIPProxy.is_profile_supported方法的典型用法代码示例。如果您正苦于以下问题:Python KMIPProxy.is_profile_supported方法的具体用法?Python KMIPProxy.is_profile_supported怎么用?Python KMIPProxy.is_profile_supported使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kmip.services.kmip_client.KMIPProxy
的用法示例。
在下文中一共展示了KMIPProxy.is_profile_supported方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestClientProfileInformation
# 需要导入模块: from kmip.services.kmip_client import KMIPProxy [as 别名]
# 或者: from kmip.services.kmip_client.KMIPProxy import is_profile_supported [as 别名]
class TestClientProfileInformation(TestCase):
"""
A test suite for client profile information support.
"""
def setUp(self):
super(TestClientProfileInformation, self).setUp()
self.client = KMIPProxy()
self.conformance_clauses = [ConformanceClause.DISCOVER_VERSIONS]
self.authentication_suites = [AuthenticationSuite.BASIC]
self.client.conformance_clauses = self.conformance_clauses
self.client.authentication_suites = self.authentication_suites
def tearDown(self):
super(TestClientProfileInformation, self).tearDown()
def test_get_supported_conformance_clauses(self):
"""
Test that the list of supporting conformance clauses can be retrieved.
"""
conformance_clauses = self.client.get_supported_conformance_clauses()
self.assertEqual(self.conformance_clauses, conformance_clauses)
def test_get_supported_authentication_suites(self):
"""
Test that the list of supporting authentication suites can be
retrieved.
"""
auth_suites = self.client.get_supported_authentication_suites()
self.assertEqual(self.authentication_suites, auth_suites)
def test_is_conformance_clause_supported_with_valid(self):
"""
Test that the conformance clause support predicate returns True for
a ConformanceClause that is supported.
"""
clause = ConformanceClause.DISCOVER_VERSIONS
supported = self.client.is_conformance_clause_supported(clause)
self.assertTrue(supported)
def test_is_conformance_clause_supported_with_invalid(self):
"""
Test that the conformance clause support predicate returns False for
a ConformanceClause that is not supported.
"""
clause = ConformanceClause.BASELINE
supported = self.client.is_conformance_clause_supported(clause)
self.assertFalse(supported)
def test_is_authentication_suite_supported_with_valid(self):
"""
Test that the authentication suite support predicate returns True for
an AuthenticationSuite that is supported.
"""
suite = AuthenticationSuite.BASIC
supported = self.client.is_authentication_suite_supported(suite)
self.assertTrue(supported)
def test_is_authentication_suite_supported_with_invalid(self):
"""
Test that the authentication suite support predicate returns False for
an AuthenticationSuite that is not supported.
"""
suite = AuthenticationSuite.TLS12
supported = self.client.is_authentication_suite_supported(suite)
self.assertFalse(supported)
def test_is_profile_supported(self):
"""
Test that the profile support predicate returns True for valid profile
components.
"""
supported = self.client.is_profile_supported(
ConformanceClause.DISCOVER_VERSIONS,
AuthenticationSuite.BASIC)
self.assertTrue(supported)
# TODO (peter-hamilton) Replace following 3 tests with 1 parameterized test
def test_is_profile_supported_with_invalid_conformance_clause(self):
"""
Test that the profile support predicate returns False for an invalid
conformance clause.
"""
supported = self.client.is_profile_supported(
ConformanceClause.BASELINE,
AuthenticationSuite.BASIC)
self.assertFalse(supported)
def test_is_profile_supported_with_invalid_authentication_suite(self):
"""
Test that the profile support predicate returns False for an invalid
authentication suite.
"""
supported = self.client.is_profile_supported(
ConformanceClause.DISCOVER_VERSIONS,
AuthenticationSuite.TLS12)
self.assertFalse(supported)
#.........这里部分代码省略.........