aboutsummaryrefslogtreecommitdiff
blob: 415277bc7ae9394afb851fd46546b7d66f4025ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# 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 RegularSlotChangeWithoutRevBumpTestCase(TestCase):

	def testRegularSlotChangeWithoutRevBumpTestCase(self):

		ebuilds = {
			"dev-libs/boost-1.52.0" : {
				"SLOT": "0"
			},
			"app-office/libreoffice-4.0.0.2" : {
				"EAPI": "5",
				"DEPEND": ">=dev-libs/boost-1.46:=",
				"RDEPEND": ">=dev-libs/boost-1.46:=",
			},
		}

		binpkgs = {
			"dev-libs/boost-1.52.0" : {
				"SLOT": "1.52"
			},
		}

		installed = {
			"dev-libs/boost-1.52.0" : {
				"SLOT": "1.52"
			},
		}

		world = []

		test_cases = (
			# Test that @__auto_slot_operator_replace_installed__
			# pulls in the available slot, even though it's
			# different from the installed slot (0 instead of 1.52).
			ResolverPlaygroundTestCase(
				["app-office/libreoffice"],
				options = {"--oneshot": True, "--usepkg": True},
				success = True,
				mergelist = [
					'dev-libs/boost-1.52.0',
					'app-office/libreoffice-4.0.0.2'
				]
			),
		)

		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()