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


Python Core.create_instance方法代码示例

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


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

示例1: test_match_product

# 需要导入模块: from core.core import Core [as 别名]
# 或者: from core.core.Core import create_instance [as 别名]
    def test_match_product(self):
        p = Product(core=Core.create_instance())
        p.merge(product="Zoo", version="4.0")

        self.assertTrue(ProductComparer("zoo>3.0.0.1").match('zoo', '4.0'))
        self.assertFalse(ProductComparer("zoo>4.0").match('zoo', '4.0'))
        self.assertFalse(ProductComparer("foo>3.0").match('zoo', '4.0'))
开发者ID:perldev,项目名称:zoo,代码行数:9,代码来源:test_product_compare.py

示例2: setUpClass

# 需要导入模块: from core.core import Core [as 别名]
# 或者: from core.core.Core import create_instance [as 别名]
    def setUpClass(cls):

        cls.core = Core.create_instance(dict(os='windows', bitness='64'))

        cls.core.feed.raw_collection.append(dict(product='x', os='windows', title='X'))
        cls.core.feed.raw_collection.append(dict(product='x', os='windows', bitness='64', version='1.3.5'))
        cls.core.feed.raw_collection.append(dict(product='x', os='windows', bitness='64', version='1.3.7'))
        cls.core.feed.raw_collection.append(dict(product='x', os='windows', bitness='64', version='1.3.9'))

        cls.core.feed.raw_collection.append(dict(product='y'))
        cls.core.feed.raw_collection.append(dict(product='y', os='windows', bitness='64', version='1.5.0'))
        cls.core.feed.raw_collection.append(dict(product='y', os='windows', bitness='64', version='1.5.2'))
        cls.core.feed.raw_collection.append(dict(product='y', os='windows', bitness='64', version='1.5.4'))
开发者ID:perldev,项目名称:zoo,代码行数:15,代码来源:test_bucket.py

示例3: test_remove_product

# 需要导入模块: from core.core import Core [as 别名]
# 或者: from core.core.Core import create_instance [as 别名]
    def test_remove_product(self):
        core = Core.create_instance(dict(os='windows', bitness='64'))

        core.feed.raw_collection.append(dict(product='x', os='windows'))
        core.feed.raw_collection.append(dict(product='x', os='windows', bitness='64', version='1.3.5'))
        core.feed.raw_collection.append(dict(product='x', os='windows', bitness='64', version='1.3.7'))

        core.feed.raw_collection.append(dict(product='y'))
        core.feed.raw_collection.append(dict(product='y', os='windows', bitness='64', version='1.5.0'))
        core.feed.raw_collection.append(dict(product='y', os='windows', bitness='64', version='1.5.2'))

        self.assertEqual(len(core.feed.raw_collection), 6)

        core.feed.remove_product('x')

        self.assertEqual(len(core.feed.raw_collection), 3)
        self.assertIsNone(core.feed.get_product('x'))
        self.assertIsNotNone(core.feed.get_product('y'))
开发者ID:helicontech,项目名称:zoo,代码行数:20,代码来源:test_bucket.py

示例4: setUpClass

# 需要导入模块: from core.core import Core [as 别名]
# 或者: from core.core.Core import create_instance [as 别名]
 def setUpClass(cls):
     cls.core = Core.create_instance(dict(os='windows', bitness='64'))
     cls.core.feed.raw_collection.extend([
         {
             'product': 'P1',
             'version': '1.1'
         },
         {
             'product': 'P1',
             'version': '1.2',
         },
         {
             'application': 'A1',
             'dependencies': ['P1']
         },
         {
             'application': 'A2',
             'dependencies': ['P1==1.1']
         },
         {
             'product': 'P1',
             'version': '1.3',
         },
     ])
开发者ID:perldev,项目名称:zoo,代码行数:26,代码来源:test_dependencies.py

示例5: setUpClass

# 需要导入模块: from core.core import Core [as 别名]
# 或者: from core.core.Core import create_instance [as 别名]
 def setUpClass(cls):
     cls.core = Core.create_instance(dict(os='windows', bitness='64'))
     cls.core.feed.raw_collection.append(dict(application='app1', title='App1'))
     cls.core.feed.raw_collection.append(dict(application='app2', title='App2'))
开发者ID:perldev,项目名称:zoo,代码行数:6,代码来源:test_apps.py

示例6: setUpClass

# 需要导入模块: from core.core import Core [as 别名]
# 或者: from core.core.Core import create_instance [as 别名]
 def setUpClass(cls):
     cls.core = Core.create_instance()
     cls.registry = cls.core.api.os.registry
开发者ID:perldev,项目名称:zoo,代码行数:5,代码来源:test_api_windows.py

示例7: setUpClass

# 需要导入模块: from core.core import Core [as 别名]
# 或者: from core.core.Core import create_instance [as 别名]
 def setUpClass(cls):
     cls.core = Core.create_instance(dict(os='windows', bitness='64'))
开发者ID:perldev,项目名称:zoo,代码行数:4,代码来源:test_parameters.py


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