From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id D1392138E66 for ; Mon, 24 Feb 2014 20:04:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1252AE0A5F; Mon, 24 Feb 2014 20:04:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 997F1E0A5F for ; Mon, 24 Feb 2014 20:04:01 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8831933FA7F for ; Mon, 24 Feb 2014 20:04:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 3E52118875 for ; Mon, 24 Feb 2014 20:03:59 +0000 (UTC) From: "Sebastian Luther" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sebastian Luther" Message-ID: <1393270293.92a7b16bd71ee630b34583bd848e5f7b922c59a7.few@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/tests/resolver/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/tests/resolver/test_useflags.py X-VCS-Directories: pym/portage/tests/resolver/ X-VCS-Committer: few X-VCS-Committer-Name: Sebastian Luther X-VCS-Revision: 92a7b16bd71ee630b34583bd848e5f7b922c59a7 X-VCS-Branch: master Date: Mon, 24 Feb 2014 20:03:59 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 73f59e28-0b8d-48a3-ab6e-1003a6e34451 X-Archives-Hash: 54e6427370d4248a0d8e2ca3880ae52b commit: 92a7b16bd71ee630b34583bd848e5f7b922c59a7 Author: David James google com> AuthorDate: Mon Feb 24 18:14:26 2014 +0000 Commit: Sebastian Luther gmx de > CommitDate: Mon Feb 24 19:31:33 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=92a7b16b Add a test case for --newuse, --changed-use, and --binpkg-respect-use. Change-Id: I201e468c6e7cda6aa961371ad9ddc10cfab04bc7 --- pym/portage/tests/resolver/test_useflags.py | 78 +++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/pym/portage/tests/resolver/test_useflags.py b/pym/portage/tests/resolver/test_useflags.py new file mode 100644 index 0000000..0a5f3b3 --- /dev/null +++ b/pym/portage/tests/resolver/test_useflags.py @@ -0,0 +1,78 @@ +# Copyright 2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.tests.resolver.ResolverPlayground import ResolverPlayground, ResolverPlaygroundTestCase + +class UseFlagsTestCase(TestCase): + + def testUseFlags(self): + ebuilds = { + "dev-libs/A-1": { "IUSE": "X", }, + "dev-libs/B-1": { "IUSE": "X Y", }, + } + + installed = { + "dev-libs/A-1": { "IUSE": "X", }, + "dev-libs/B-1": { "IUSE": "X", }, + } + + binpkgs = installed + + user_config = { + "package.use": ( "dev-libs/A X", ), + "use.force": ( "Y", ), + } + + test_cases = ( + #default: don't reinstall on use flag change + ResolverPlaygroundTestCase( + ["dev-libs/A"], + options = {"--selective": True, "--usepkg": True}, + success = True, + mergelist = []), + + #default: respect use flags for binpkgs + ResolverPlaygroundTestCase( + ["dev-libs/A"], + options = {"--usepkg": True}, + success = True, + mergelist = ["dev-libs/A-1"]), + + #--binpkg-respect-use=n: use binpkgs with different use flags + ResolverPlaygroundTestCase( + ["dev-libs/A"], + options = {"--binpkg-respect-use": "n", "--usepkg": True}, + success = True, + mergelist = ["[binary]dev-libs/A-1"]), + + #--reinstall=changed-use: reinstall if use flag changed + ResolverPlaygroundTestCase( + ["dev-libs/A"], + options = {"--reinstall": "changed-use", "--usepkg": True}, + success = True, + mergelist = ["dev-libs/A-1"]), + + #--reinstall=changed-use: don't reinstall on new use flag + ResolverPlaygroundTestCase( + ["dev-libs/B"], + options = {"--reinstall": "changed-use", "--usepkg": True}, + success = True, + mergelist = []), + + #--newuse: reinstall on new use flag + ResolverPlaygroundTestCase( + ["dev-libs/B"], + options = {"--newuse": True, "--usepkg": True}, + success = True, + mergelist = ["dev-libs/B-1"]), + ) + + playground = ResolverPlayground(ebuilds=ebuilds, + binpkgs=binpkgs, installed=installed, 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()