当前位置: 首页>>代码示例>>Python>>正文


Python InstallationInfo.get_attributes方法代码示例

本文整理汇总了Python中nailgun.statistics.fuel_statistics.installation_info.InstallationInfo.get_attributes方法的典型用法代码示例。如果您正苦于以下问题:Python InstallationInfo.get_attributes方法的具体用法?Python InstallationInfo.get_attributes怎么用?Python InstallationInfo.get_attributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nailgun.statistics.fuel_statistics.installation_info.InstallationInfo的用法示例。


在下文中一共展示了InstallationInfo.get_attributes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_get_attributes_centos

# 需要导入模块: from nailgun.statistics.fuel_statistics.installation_info import InstallationInfo [as 别名]
# 或者: from nailgun.statistics.fuel_statistics.installation_info.InstallationInfo import get_attributes [as 别名]
 def test_get_attributes_centos(self):
     self.skipTest("CentOS is unavailable in current release.")
     self.env.upload_fixtures(["openstack"])
     info = InstallationInfo()
     release = ReleaseCollection.filter_by(None, operating_system="CentOS")
     cluster_data = self.env.create_cluster(release_id=release[0].id)
     cluster = Cluster.get_by_uid(cluster_data["id"])
     editable = cluster.attributes.editable
     attr_key_list = [a[1] for a in info.attributes_white_list]
     attrs_dict = info.get_attributes(editable, info.attributes_white_list)
     self.assertEqual(set(attr_key_list), set(attrs_dict.keys()))
开发者ID:gdyuldin,项目名称:fuel-web,代码行数:13,代码来源:test_installation_info.py

示例2: test_get_attributes_exception_handled

# 需要导入模块: from nailgun.statistics.fuel_statistics.installation_info import InstallationInfo [as 别名]
# 或者: from nailgun.statistics.fuel_statistics.installation_info.InstallationInfo import get_attributes [as 别名]
 def test_get_attributes_exception_handled(self):
     info = InstallationInfo()
     variants = [
         None,
         {},
         {'common': None},
         {'common': {'libvirt_type': {}}},
         {'common': {'libvirt_type': 3}},
     ]
     for attrs in variants:
         result = info.get_attributes(attrs, info.attributes_white_list)
         self.assertDictEqual({}, result)
开发者ID:apporc,项目名称:fuel-web,代码行数:14,代码来源:test_installation_info.py

示例3: test_get_attributes_ubuntu

# 需要导入模块: from nailgun.statistics.fuel_statistics.installation_info import InstallationInfo [as 别名]
# 或者: from nailgun.statistics.fuel_statistics.installation_info.InstallationInfo import get_attributes [as 别名]
 def test_get_attributes_ubuntu(self):
     self.env.upload_fixtures(["openstack"])
     info = InstallationInfo()
     release = ReleaseCollection.filter_by(None, operating_system="Ubuntu")
     cluster_data = self.env.create_cluster(release_id=release[0].id)
     cluster = Cluster.get_by_uid(cluster_data["id"])
     editable = cluster.attributes.editable
     attr_key_list = [a[1] for a in info.attributes_white_list]
     attrs_dict = info.get_attributes(editable, info.attributes_white_list)
     self.assertEqual(
         # no vlan splinters for ubuntu
         set(attr_key_list) - set(("vlan_splinters", "vlan_splinters_ovs")),
         set(attrs_dict.keys()),
     )
开发者ID:gdyuldin,项目名称:fuel-web,代码行数:16,代码来源:test_installation_info.py

示例4: _do_test_attributes_in_white_list

# 需要导入模块: from nailgun.statistics.fuel_statistics.installation_info import InstallationInfo [as 别名]
# 或者: from nailgun.statistics.fuel_statistics.installation_info.InstallationInfo import get_attributes [as 别名]
    def _do_test_attributes_in_white_list(self, release,
                                          expected_attributes):
        cluster_data = self.env.create_cluster(
            release_id=release.id
        )
        cluster = Cluster.get_by_uid(cluster_data['id'])
        editable = cluster.attributes.editable

        info = InstallationInfo()
        actual_attributes = info.get_attributes(
            editable, info.attributes_white_list)
        self.assertEqual(
            set(expected_attributes),
            set(actual_attributes.keys())
        )
开发者ID:mmalchuk,项目名称:openstack-fuel-web,代码行数:17,代码来源:test_installation_info.py

示例5: test_get_attributes_ubuntu

# 需要导入模块: from nailgun.statistics.fuel_statistics.installation_info import InstallationInfo [as 别名]
# 或者: from nailgun.statistics.fuel_statistics.installation_info.InstallationInfo import get_attributes [as 别名]
 def test_get_attributes_ubuntu(self):
     self.env.upload_fixtures(['openstack'])
     info = InstallationInfo()
     release = ReleaseCollection.filter_by(None, operating_system='Ubuntu')
     cluster_data = self.env.create_cluster(
         release_id=release[0].id
     )
     cluster = Cluster.get_by_uid(cluster_data['id'])
     editable = cluster.attributes.editable
     attr_key_list = [a[1] for a in info.attributes_white_list]
     attrs_dict = info.get_attributes(editable, info.attributes_white_list)
     self.assertEqual(
         # No vlan splinters for ubuntu.
         # And no mellanox related entries since 8.0.
         set(attr_key_list) - set(
             ('vlan_splinters', 'vlan_splinters_ovs',
              'mellanox', 'mellanox_vf_num', 'iser')),
         set(attrs_dict.keys())
     )
开发者ID:ansumanbebarta,项目名称:fuel-web,代码行数:21,代码来源:test_installation_info.py

示例6: test_get_empty_attributes

# 需要导入模块: from nailgun.statistics.fuel_statistics.installation_info import InstallationInfo [as 别名]
# 或者: from nailgun.statistics.fuel_statistics.installation_info.InstallationInfo import get_attributes [as 别名]
 def test_get_empty_attributes(self):
     info = InstallationInfo()
     trash_attrs = {'some': 'trash', 'nested': {'n': 't'}}
     result = info.get_attributes(trash_attrs, info.attributes_white_list)
     self.assertDictEqual({}, result)
开发者ID:apporc,项目名称:fuel-web,代码行数:7,代码来源:test_installation_info.py


注:本文中的nailgun.statistics.fuel_statistics.installation_info.InstallationInfo.get_attributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。