本文整理汇总了Python中portage.tests.resolver.ResolverPlayground.ResolverPlayground.run_TestCase方法的典型用法代码示例。如果您正苦于以下问题:Python ResolverPlayground.run_TestCase方法的具体用法?Python ResolverPlayground.run_TestCase怎么用?Python ResolverPlayground.run_TestCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portage.tests.resolver.ResolverPlayground.ResolverPlayground
的用法示例。
在下文中一共展示了ResolverPlayground.run_TestCase方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testBacktrackNoWrongRebuilds
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testBacktrackNoWrongRebuilds(self):
"""
Ensure we remove backtrack masks if the reason for the mask gets masked itself.
"""
ebuilds = {
"dev-libs/A-1": {},
"dev-libs/A-2": {},
"dev-libs/B-1": {"RDEPEND": "dev-libs/D"},
"dev-libs/C-1": {},
"dev-libs/C-2": {"RDEPEND": ">=dev-libs/A-2"},
"dev-libs/D-1": {"RDEPEND": "<dev-libs/A-2"},
}
installed = {
"dev-libs/A-1": {},
"dev-libs/B-1": {"RDEPEND": "dev-libs/D"},
"dev-libs/C-1": {},
"dev-libs/D-1": {"RDEPEND": "<dev-libs/A-2"},
}
world = ["dev-libs/B", "dev-libs/C"]
options = {"--update": True, "--deep": True, "--selective": True}
test_cases = (ResolverPlaygroundTestCase(["@world"], options=options, mergelist=[], success=True),)
playground = ResolverPlayground(ebuilds=ebuilds, installed=installed, world=world)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
示例2: testBacktrackMissedUpdates
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testBacktrackMissedUpdates(self):
"""
An update is missed due to a dependency on an older version.
"""
ebuilds = {
"dev-libs/A-1": { },
"dev-libs/A-2": { },
"dev-libs/B-1": { "RDEPEND": "<=dev-libs/A-1" },
}
installed = {
"dev-libs/A-1": { "USE": "" },
"dev-libs/B-1": { "USE": "", "RDEPEND": "<=dev-libs/A-1" },
}
options = {'--update' : True, '--deep' : True, '--selective' : True}
test_cases = (
ResolverPlaygroundTestCase(
["dev-libs/A", "dev-libs/B"],
options = options,
all_permutations = True,
mergelist = [],
success = True),
)
playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
示例3: testHittingTheBacktrackLimit
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testHittingTheBacktrackLimit(self):
ebuilds = {
"dev-libs/A-1": {},
"dev-libs/A-2": {},
"dev-libs/B-1": {},
"dev-libs/B-2": {},
"dev-libs/C-1": { "DEPEND": "dev-libs/A dev-libs/B" },
"dev-libs/D-1": { "DEPEND": "=dev-libs/A-1 =dev-libs/B-1" },
}
test_cases = (
ResolverPlaygroundTestCase(
["dev-libs/C", "dev-libs/D"],
all_permutations = True,
mergelist = ["dev-libs/A-1", "dev-libs/B-1", "dev-libs/C-1", "dev-libs/D-1"],
ignore_mergelist_order = True,
success = True),
#This one hits the backtrack limit. Be aware that this depends on the argument order.
ResolverPlaygroundTestCase(
["dev-libs/D", "dev-libs/C"],
options = { "--backtrack": 1 },
mergelist = ["dev-libs/A-1", "dev-libs/B-1", "dev-libs/A-2", "dev-libs/B-2", "dev-libs/C-1", "dev-libs/D-1"],
ignore_mergelist_order = True,
slot_collision_solutions = [],
success = False),
)
playground = ResolverPlayground(ebuilds=ebuilds)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
示例4: testDirectVirtualCircularDependency
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testDirectVirtualCircularDependency(self):
# Bug #384107
self.todo = True
ebuilds = {
"dev-java/icedtea-6.1.10.3": { "SLOT" : "6", "DEPEND": "virtual/jdk" },
"dev-java/icedtea6-bin-1.10.3": {},
"virtual/jdk-1.6.0": { "SLOT" : "1.6", "RDEPEND": "|| ( dev-java/icedtea6-bin =dev-java/icedtea-6* )" },
}
test_cases = (
# Automatically pull in icedtea6-bin to solve a circular dep
ResolverPlaygroundTestCase(
["dev-java/icedtea"],
mergelist = ["dev-java/icedtea6-bin-1.10.3", "virtual/jdk-1.6.0", "dev-java/icedtea-6.1.10.3"],
success = True,
),
)
playground = ResolverPlayground(ebuilds=ebuilds)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
示例5: testWithTestDeps
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testWithTestDeps(self):
ebuilds = {
"app-misc/A-0": {
"EAPI": "5",
"IUSE": "test",
"DEPEND": "test? ( app-misc/B )"
},
"app-misc/B-0": {
"EAPI": "5",
"IUSE": "test",
"DEPEND": "test? ( app-misc/C )"
},
"app-misc/C-0": {
"EAPI": "5",
}
}
test_cases = (
# Test that --with-test-deps only pulls in direct
# test deps of packages matched by arguments.
ResolverPlaygroundTestCase(
["app-misc/A"],
success = True,
options = { "--onlydeps": True, "--with-test-deps": True },
mergelist = ["app-misc/B-0"]),
)
playground = ResolverPlayground(ebuilds=ebuilds, debug=False)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success,
True, test_case.fail_msg)
finally:
playground.cleanup()
示例6: testDepcleanInstalledKeywordMaskedSlot
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testDepcleanInstalledKeywordMaskedSlot(self):
"""
Verify that depclean removes newer slot
masked by KEYWORDS (see bug #350285).
"""
ebuilds = {
"dev-libs/A-1": { "RDEPEND": "|| ( =dev-libs/B-2.7* =dev-libs/B-2.6* )" },
"dev-libs/B-2.6": { "SLOT":"2.6", "KEYWORDS": "x86" },
"dev-libs/B-2.7": { "SLOT":"2.7", "KEYWORDS": "~x86" },
}
installed = {
"dev-libs/A-1": { "EAPI" : "3", "RDEPEND": "|| ( dev-libs/B:2.7 dev-libs/B:2.6 )" },
"dev-libs/B-2.6": { "SLOT":"2.6", "KEYWORDS": "x86" },
"dev-libs/B-2.7": { "SLOT":"2.7", "KEYWORDS": "~x86" },
}
world = (
"dev-libs/A",
)
test_cases = (
ResolverPlaygroundTestCase(
[],
options={"--depclean": True},
success=True,
cleanlist=["dev-libs/B-2.7"]),
)
playground = ResolverPlayground(ebuilds=ebuilds, installed=installed, world=world)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
示例7: testSimpleDepclean
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testSimpleDepclean(self):
ebuilds = {
"dev-libs/A-1": {},
"dev-libs/B-1": {},
}
installed = {
"dev-libs/A-1": {},
"dev-libs/B-1": {},
}
world = (
"dev-libs/A",
)
test_cases = (
ResolverPlaygroundTestCase(
[],
options={"--depclean": True},
success=True,
cleanlist=["dev-libs/B-1"]),
)
playground = ResolverPlayground(ebuilds=ebuilds, installed=installed, world=world)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
示例8: testOnlydeps
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testOnlydeps(self):
ebuilds = {
"dev-libs/A-1": { "DEPEND": "dev-libs/B" },
"dev-libs/B-1": { },
}
installed = {
"dev-libs/B-1": { },
}
test_cases = (
ResolverPlaygroundTestCase(
["dev-libs/A", "dev-libs/B"],
all_permutations = True,
success = True,
options = { "--onlydeps": True },
mergelist = ["dev-libs/B-1"]),
)
playground = ResolverPlayground(ebuilds=ebuilds,
installed=installed, debug=False)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
示例9: testAutounmaskMultilibUse
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testAutounmaskMultilibUse(self):
self.todo = True
ebuilds = {
"x11-proto/xextproto-7.2.1-r1": {"EAPI": "5", "IUSE": "abi_x86_32 abi_x86_64"},
"x11-libs/libXaw-1.0.11-r2": {
"EAPI": "5",
"IUSE": "abi_x86_32 abi_x86_64",
"RDEPEND": "x11-proto/xextproto[abi_x86_32(-)?,abi_x86_64(-)?]",
},
"app-emulation/emul-linux-x86-xlibs-20130224-r2": {"EAPI": "5", "RDEPEND": "x11-libs/libXaw[abi_x86_32]"},
"games-util/steam-client-meta-0-r20130514": {"EAPI": "5", "RDEPEND": "app-emulation/emul-linux-x86-xlibs"},
}
installed = {
"x11-proto/xextproto-7.2.1-r1": {
"EAPI": "5",
"IUSE": "abi_x86_32 abi_x86_64",
"USE": "abi_x86_32 abi_x86_64",
},
"x11-libs/libXaw-1.0.11-r2": {
"EAPI": "5",
"IUSE": "abi_x86_32 abi_x86_64",
"RDEPEND": "x11-proto/xextproto[abi_x86_32(-)?,abi_x86_64(-)?]",
"USE": "abi_x86_32 abi_x86_64",
},
"app-emulation/emul-linux-x86-xlibs-20130224-r2": {"EAPI": "5", "RDEPEND": "x11-libs/libXaw[abi_x86_32]"},
"games-util/steam-client-meta-0-r20130514": {"EAPI": "5", "RDEPEND": "app-emulation/emul-linux-x86-xlibs"},
}
user_config = {
# "make.conf" : ("USE=\"abi_x86_32 abi_x86_64\"",)
"make.conf": ('USE="abi_x86_64"',)
}
world = ("games-util/steam-client-meta",)
test_cases = (
# Test autounmask solving of multilib use deps for bug #481628.
# We would like it to suggest some USE changes, but instead it
# currently fails with a SLOT conflict.
ResolverPlaygroundTestCase(
["x11-proto/xextproto", "x11-libs/libXaw"],
options={"--oneshot": True, "--autounmask": True, "--backtrack": 30},
mergelist=["x11-proto/xextproto-7.2.1-r1", "x11-libs/libXaw-1.0.11-r2"],
success=True,
),
)
playground = ResolverPlayground(
ebuilds=ebuilds, installed=installed, user_config=user_config, world=world, debug=False
)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
示例10: testOldDepChainDisplay
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testOldDepChainDisplay(self):
ebuilds = {
"dev-libs/A-1": { "DEPEND": "foo? ( dev-libs/B[-bar] )", "IUSE": "+foo", "EAPI": "2" },
"dev-libs/A-2": { "DEPEND": "foo? ( dev-libs/C )", "IUSE": "+foo", "EAPI": "1" },
"dev-libs/B-1": { "IUSE": "bar", "DEPEND": "!bar? ( dev-libs/D[-baz] )", "EAPI": "2" },
"dev-libs/C-1": { "KEYWORDS": "~x86" },
"dev-libs/D-1": { "IUSE": "+baz", "EAPI": "1" },
}
test_cases = (
ResolverPlaygroundTestCase(
["=dev-libs/A-1"],
options = { "--autounmask": 'n' },
success = False),
ResolverPlaygroundTestCase(
["=dev-libs/A-2"],
options = { "--autounmask": 'n' },
success = False),
)
playground = ResolverPlayground(ebuilds=ebuilds)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
示例11: testSlotChangeWithoutRevBump
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testSlotChangeWithoutRevBump(self):
ebuilds = {
"app-arch/libarchive-3.1.1" : {
"EAPI": "5",
"SLOT": "0/13"
},
"app-arch/libarchive-3.0.4-r1" : {
"EAPI": "5",
"SLOT": "0"
},
"kde-base/ark-4.10.0" : {
"EAPI": "5",
"DEPEND": "app-arch/libarchive:=",
"RDEPEND": "app-arch/libarchive:="
},
}
binpkgs = {
"app-arch/libarchive-3.1.1" : {
"EAPI": "5",
"SLOT": "0"
},
}
installed = {
"app-arch/libarchive-3.1.1" : {
"EAPI": "5",
"SLOT": "0"
},
"kde-base/ark-4.10.0" : {
"EAPI": "5",
"DEPEND": "app-arch/libarchive:0/0=",
"RDEPEND": "app-arch/libarchive:0/0="
},
}
world = ["kde-base/ark"]
test_cases = (
# Demonstrate bug #456208, where a sub-slot change
# without revbump needs to trigger a rebuild.
ResolverPlaygroundTestCase(
["kde-base/ark"],
options = {"--oneshot": True, "--usepkg": True},
success = True,
mergelist = ['app-arch/libarchive-3.1.1', "kde-base/ark-4.10.0"]),
)
playground = ResolverPlayground(ebuilds=ebuilds, binpkgs=binpkgs,
installed=installed, world=world, debug=False)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
示例12: testBacktrackNotNeeded
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testBacktrackNotNeeded(self):
ebuilds = {
"dev-libs/A-1": {},
"dev-libs/A-2": {},
"dev-libs/B-1": {},
"dev-libs/B-2": {},
"dev-libs/C-1": {"DEPEND": "dev-libs/A dev-libs/B"},
"dev-libs/D-1": {"DEPEND": "=dev-libs/A-1 =dev-libs/B-1"},
}
test_cases = (
ResolverPlaygroundTestCase(
["dev-libs/C", "dev-libs/D"],
all_permutations=True,
options={"--backtrack": 1},
mergelist=["dev-libs/A-1", "dev-libs/B-1", "dev-libs/C-1", "dev-libs/D-1"],
ignore_mergelist_order=True,
success=True,
),
)
playground = ResolverPlayground(ebuilds=ebuilds)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
示例13: testAutounmaskParentUse
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testAutounmaskParentUse(self):
ebuilds = {
"dev-libs/B-1": {
"EAPI": "5",
"DEPEND": "dev-libs/D[foo(-)?,bar(-)?]",
"IUSE": "+bar +foo",
},
"dev-libs/D-1": {},
}
test_cases = (
# Test bug 566704
ResolverPlaygroundTestCase(
["=dev-libs/B-1"],
options={"--autounmask": True},
success=False,
use_changes={
"dev-libs/B-1": {
"foo": False,
"bar": False,
}
}),
)
playground = ResolverPlayground(ebuilds=ebuilds)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
示例14: testBacktrackingGoodVersionFirst
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testBacktrackingGoodVersionFirst(self):
"""
When backtracking due to slot conflicts, we masked the version that has been pulled
in first. This is not always a good idea. Mask the highest version instead.
"""
ebuilds = {
"dev-libs/A-1": { "DEPEND": "=dev-libs/C-1 dev-libs/B" },
"dev-libs/B-1": { "DEPEND": "=dev-libs/C-1" },
"dev-libs/B-2": { "DEPEND": "=dev-libs/C-2" },
"dev-libs/C-1": { },
"dev-libs/C-2": { },
}
test_cases = (
ResolverPlaygroundTestCase(
["dev-libs/A"],
mergelist = ["dev-libs/C-1", "dev-libs/B-1", "dev-libs/A-1", ],
success = True),
)
playground = ResolverPlayground(ebuilds=ebuilds)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
示例15: testBacktrackWithoutUpdates
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import run_TestCase [as 别名]
def testBacktrackWithoutUpdates(self):
"""
If --update is not given we might have to mask the old installed version later.
"""
ebuilds = {
"dev-libs/A-1": { "DEPEND": "dev-libs/Z" },
"dev-libs/B-1": { "DEPEND": ">=dev-libs/Z-2" },
"dev-libs/Z-1": { },
"dev-libs/Z-2": { },
}
installed = {
"dev-libs/Z-1": { "USE": "" },
}
test_cases = (
ResolverPlaygroundTestCase(
["dev-libs/B", "dev-libs/A"],
all_permutations = True,
mergelist = ["dev-libs/Z-2", "dev-libs/B-1", "dev-libs/A-1", ],
ignore_mergelist_order = True,
success = True),
)
playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()