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


Python ResolverPlayground.ResolverPlayground类代码示例

本文整理汇总了Python中portage.tests.resolver.ResolverPlayground.ResolverPlayground的典型用法代码示例。如果您正苦于以下问题:Python ResolverPlayground类的具体用法?Python ResolverPlayground怎么用?Python ResolverPlayground使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testOldDepChainDisplay

	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()
开发者ID:Acidburn0zzz,项目名称:portage-funtoo,代码行数:27,代码来源:test_old_dep_chain_display.py

示例2: testOnlydeps

	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()
开发者ID:Spencerx,项目名称:portage,代码行数:26,代码来源:test_onlydeps.py

示例3: testSlotChangeWithoutRevBump

	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()
开发者ID:Spencerx,项目名称:portage,代码行数:60,代码来源:test_slot_change_without_revbump.py

示例4: testSetCpv

	def testSetCpv(self):
		"""
		Test the clone via constructor.
		"""

		ebuilds = {
			"dev-libs/A-1": {"IUSE": "static-libs"},
			"dev-libs/B-1": {"IUSE": "static-libs"},
		}

		env_files = {
			"A" : ("USE=\"static-libs\"",)
		}

		package_env = (
			"dev-libs/A A",
		)

		eprefix = normalize_path(tempfile.mkdtemp())
		playground = None
		try:
			user_config_dir = os.path.join(eprefix, USER_CONFIG_PATH)
			os.makedirs(user_config_dir)

			with io.open(os.path.join(user_config_dir, "package.env"),
				mode='w', encoding=_encodings['content']) as f:
				for line in package_env:
					f.write(line + "\n")

			env_dir = os.path.join(user_config_dir, "env")
			os.makedirs(env_dir)
			for k, v in env_files.items():
				with io.open(os.path.join(env_dir, k), mode='w',
					encoding=_encodings['content']) as f:
					for line in v:
						f.write(line + "\n")

			playground = ResolverPlayground(eprefix=eprefix, ebuilds=ebuilds)
			settings = config(clone=playground.settings)

			result = playground.run(["=dev-libs/A-1"])
			pkg, existing_node = result.depgraph._select_package(
				playground.eroot, Atom("=dev-libs/A-1"))
			settings.setcpv(pkg)
			self.assertTrue("static-libs" in
				settings["PORTAGE_USE"].split())

			# Test bug #522362, where a USE=static-libs package.env
			# setting leaked from one setcpv call to the next.
			pkg, existing_node = result.depgraph._select_package(
				playground.eroot, Atom("=dev-libs/B-1"))
			settings.setcpv(pkg)
			self.assertTrue("static-libs" not in
				settings["PORTAGE_USE"].split())

		finally:
			if playground is None:
				shutil.rmtree(eprefix)
			else:
				playground.cleanup()
开发者ID:gentoo,项目名称:portage,代码行数:60,代码来源:test_config.py

示例5: testBacktrackingGoodVersionFirst

	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()
开发者ID:Acidburn0zzz,项目名称:portage-funtoo,代码行数:29,代码来源:test_backtracking.py

示例6: testBacktrackNoWrongRebuilds

    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()
开发者ID:nullishzero,项目名称:portage-1,代码行数:35,代码来源:test_backtracking.py

示例7: testBacktrackNotNeeded

    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()
开发者ID:nullishzero,项目名称:portage-1,代码行数:29,代码来源:test_backtracking.py

示例8: testWithTestDeps

	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()
开发者ID:aeroniero33,项目名称:portage,代码行数:35,代码来源:test_with_test_deps.py

示例9: testDirectVirtualCircularDependency

	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()
开发者ID:Acidburn0zzz,项目名称:portage-funtoo,代码行数:27,代码来源:test_circular_choices.py

示例10: testSimpleDepclean

	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()
开发者ID:aeroniero33,项目名称:portage,代码行数:29,代码来源:test_depclean.py

示例11: testAutounmaskMultilibUse

    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()
开发者ID:lucianposton,项目名称:portage,代码行数:60,代码来源:test_autounmask_multilib_use.py

示例12: testPackageMaskOrder

    def testPackageMaskOrder(self):

        ebuilds = {"dev-libs/A-1": {}, "dev-libs/B-1": {}, "dev-libs/C-1": {}, "dev-libs/D-1": {}, "dev-libs/E-1": {}}

        repo_configs = {"test_repo": {"package.mask": ("dev-libs/A", "dev-libs/C")}}

        profile = {"package.mask": ("-dev-libs/A", "dev-libs/B", "-dev-libs/B", "dev-libs/D")}

        user_config = {"package.mask": ("-dev-libs/C", "-dev-libs/D", "dev-libs/E")}

        test_cases = (
            ResolverPlaygroundTestCase(["dev-libs/A"], options={"--autounmask": "n"}, success=False),
            ResolverPlaygroundTestCase(["dev-libs/B"], success=True, mergelist=["dev-libs/B-1"]),
            ResolverPlaygroundTestCase(["dev-libs/C"], success=True, mergelist=["dev-libs/C-1"]),
            ResolverPlaygroundTestCase(["dev-libs/D"], success=True, mergelist=["dev-libs/D-1"]),
            ResolverPlaygroundTestCase(["dev-libs/E"], options={"--autounmask": "n"}, success=False),
        )

        playground = ResolverPlayground(
            ebuilds=ebuilds, repo_configs=repo_configs, profile=profile, user_config=user_config
        )
        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()
开发者ID:sysrqb,项目名称:portage-funtoo,代码行数:27,代码来源:test_config.py

示例13: testFeaturesMutation

	def testFeaturesMutation(self):
		"""
		Test whether mutation of config.features updates the FEATURES
		variable and persists through config.regenerate() calls.
		"""
		playground = ResolverPlayground()
		try:
			settings = config(clone=playground.settings)

			settings.features.add('noclean')
			self.assertEqual('noclean' in settings['FEATURES'].split(), True)
			settings.regenerate()
			self.assertEqual('noclean' in settings['FEATURES'].split(),True)

			settings.features.discard('noclean')
			self.assertEqual('noclean' in settings['FEATURES'].split(), False)
			settings.regenerate()
			self.assertEqual('noclean' in settings['FEATURES'].split(), False)

			settings.features.add('noclean')
			self.assertEqual('noclean' in settings['FEATURES'].split(), True)
			settings.regenerate()
			self.assertEqual('noclean' in settings['FEATURES'].split(),True)
		finally:
			playground.cleanup()
开发者ID:Neuvoo,项目名称:legacy-portage,代码行数:25,代码来源:test_config.py

示例14: testBacktrackMissedUpdates

	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()
开发者ID:Acidburn0zzz,项目名称:portage-funtoo,代码行数:35,代码来源:test_backtracking.py

示例15: testHittingTheBacktrackLimit

	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()
开发者ID:Acidburn0zzz,项目名称:portage-funtoo,代码行数:35,代码来源:test_backtracking.py


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