summaryrefslogtreecommitdiffstats
path: root/pym/portage/tests/resolver/test_simple.py
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-08-05 15:47:00 +0200
committerZac Medico <zmedico@gentoo.org>2010-08-05 13:37:33 -0700
commit099fc66a93ae7bb8a4f3e5b2caeb08426365b923 (patch)
tree00a257219beaebee5906027f98a860507d504555 /pym/portage/tests/resolver/test_simple.py
parentd1779db3525d9c1783e67c2f31a884dae35a60a6 (diff)
downloadportage-099fc66a93ae7bb8a4f3e5b2caeb08426365b923.tar.gz
portage-099fc66a93ae7bb8a4f3e5b2caeb08426365b923.tar.bz2
portage-099fc66a93ae7bb8a4f3e5b2caeb08426365b923.zip
Tests: Add resolver/test_simple and the resolver test infrastructure
Diffstat (limited to 'pym/portage/tests/resolver/test_simple.py')
-rw-r--r--pym/portage/tests/resolver/test_simple.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/pym/portage/tests/resolver/test_simple.py b/pym/portage/tests/resolver/test_simple.py
new file mode 100644
index 000000000..d178e7fb0
--- /dev/null
+++ b/pym/portage/tests/resolver/test_simple.py
@@ -0,0 +1,32 @@
+# Copyright 2010 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
+
+class SimpleResolverTestCase(TestCase):
+
+ def testSimple(self):
+ ebuilds = {
+ "dev-libs/A-1": {},
+ "dev-libs/A-2": { "KEYWORDS": "~x86" },
+ "dev-libs/B-1.2": {},
+ }
+ installed = {
+ "dev-libs/B-1.1": {},
+ }
+
+ requests = (
+ (["dev-libs/A"], {}, None, True, ["dev-libs/A-1"]),
+ (["=dev-libs/A-2"], {}, None, False, None),
+ (["dev-libs/B"], {"--noreplace": True}, None, True, []),
+ (["dev-libs/B"], {"--update": True}, None, True, ["dev-libs/B-1.2"]),
+ )
+
+ playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)
+
+ for atoms, options, action, expected_result, expected_mergelist in requests:
+ success, mergelist = playground.run(atoms, options, action)
+ self.assertEqual(success, expected_result)
+ if success:
+ self.assertEqual(mergelist, expected_mergelist)