From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-613834-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 591BA1381F3
	for <garchives@archives.gentoo.org>; Tue, 30 Jul 2013 02:13:29 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 54C22E0A88;
	Tue, 30 Jul 2013 02:13:26 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id DCF9AE0A88
	for <gentoo-commits@lists.gentoo.org>; Tue, 30 Jul 2013 02:13:25 +0000 (UTC)
Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id F401E33EA98
	for <gentoo-commits@lists.gentoo.org>; Tue, 30 Jul 2013 02:13:24 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by hornbill.gentoo.org (Postfix) with ESMTP id 2107DE468F
	for <gentoo-commits@lists.gentoo.org>; Tue, 30 Jul 2013 02:13:22 +0000 (UTC)
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org>
Message-ID: <1375150374.2fe14319d9143610dfdb8d1d044d7432038c857c.zmedico@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_or_choices.py
X-VCS-Directories: pym/portage/tests/resolver/
X-VCS-Committer: zmedico
X-VCS-Committer-Name: Zac Medico
X-VCS-Revision: 2fe14319d9143610dfdb8d1d044d7432038c857c
X-VCS-Branch: master
Date: Tue, 30 Jul 2013 02:13:22 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 28a10240-a583-4db6-9e9a-d933b23b45fb
X-Archives-Hash: b286b9972e5940584d07f703cc5f969d

commit:     2fe14319d9143610dfdb8d1d044d7432038c857c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 30 02:08:26 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 30 02:12:54 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2fe14319

Add test for bug #478188.

---
 pym/portage/tests/resolver/test_or_choices.py | 65 +++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/pym/portage/tests/resolver/test_or_choices.py b/pym/portage/tests/resolver/test_or_choices.py
new file mode 100644
index 0000000..3bc67bc
--- /dev/null
+++ b/pym/portage/tests/resolver/test_or_choices.py
@@ -0,0 +1,65 @@
+# Copyright 2013 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 OrChoicesTestCase(TestCase):
+
+	def testOrChoices(self):
+		ebuilds = {
+			"dev-lang/vala-0.20.0" : {
+				"EAPI": "5",
+				"SLOT": "0.20"
+			},
+			"dev-lang/vala-0.18.0" : {
+				"EAPI": "5",
+				"SLOT": "0.18"
+			},
+			#"dev-libs/gobject-introspection-1.36.0" : {
+			#	"EAPI": "5",
+			#	"RDEPEND" : "!<dev-lang/vala-0.20.0",
+			#},
+			"dev-libs/gobject-introspection-1.34.0" : {
+				"EAPI": "5"
+			},
+			"sys-apps/systemd-ui-2" : {
+				"EAPI": "5",
+				"RDEPEND" : "|| ( dev-lang/vala:0.20 dev-lang/vala:0.18 )"
+			},
+		}
+
+		installed = {
+			"dev-lang/vala-0.18.0" : {
+				"EAPI": "5",
+				"SLOT": "0.18"
+			},
+			"dev-libs/gobject-introspection-1.34.0" : {
+				"EAPI": "5"
+			},
+			"sys-apps/systemd-ui-2" : {
+				"EAPI": "5",
+				"RDEPEND" : "|| ( dev-lang/vala:0.20 dev-lang/vala:0.18 )"
+			},
+		}
+
+		world = ["dev-libs/gobject-introspection", "sys-apps/systemd-ui"]
+
+		test_cases = (
+			# Demonstrate that vala:0.20 update is not pulled in, as in bug #478188
+			ResolverPlaygroundTestCase(
+				["@world"],
+				options = {"--update": True, "--deep": True},
+				success=True,
+				all_permutations = True,
+				mergelist = []),
+		)
+
+		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()