本文整理汇总了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'))
示例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'))
示例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'))
示例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',
},
])
示例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'))
示例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
示例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'))