public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
Date: Fri, 11 Jan 2013 07:22:21 +0000 (UTC)	[thread overview]
Message-ID: <1357888923.b5ef3cd3ef9261981f7f1dcadcdcf3f2a56d38f2.zmedico@gentoo> (raw)

commit:     b5ef3cd3ef9261981f7f1dcadcdcf3f2a56d38f2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 11 07:22:03 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan 11 07:22:03 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b5ef3cd3

DoebuildSpawnTestCase: also call spawn_nofetch

---
 pym/portage/tests/ebuild/test_doebuild_spawn.py |   39 ++++++++++++++++-------
 1 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/pym/portage/tests/ebuild/test_doebuild_spawn.py b/pym/portage/tests/ebuild/test_doebuild_spawn.py
index 6c66f81..ae9a5c5 100644
--- a/pym/portage/tests/ebuild/test_doebuild_spawn.py
+++ b/pym/portage/tests/ebuild/test_doebuild_spawn.py
@@ -1,12 +1,15 @@
 # Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import textwrap
+
 from portage import os
 from portage import _python_interpreter
 from portage import _shell_quote
 from portage.const import EBUILD_SH_BINARY
 from portage.package.ebuild.config import config
 from portage.package.ebuild.doebuild import spawn as doebuild_spawn
+from portage.package.ebuild._spawn_nofetch import spawn_nofetch
 from portage.tests import TestCase
 from portage.tests.resolver.ResolverPlayground import ResolverPlayground
 from portage.util._async.SchedulerInterface import SchedulerInterface
@@ -24,27 +27,37 @@ class DoebuildSpawnTestCase(TestCase):
 	"""
 
 	def testDoebuildSpawn(self):
-		playground = ResolverPlayground()
-		try:
-			settings = config(clone=playground.settings)
-			if "__PORTAGE_TEST_HARDLINK_LOCKS" in os.environ:
-				settings["__PORTAGE_TEST_HARDLINK_LOCKS"] = \
-					os.environ["__PORTAGE_TEST_HARDLINK_LOCKS"]
-				settings.backup_changes("__PORTAGE_TEST_HARDLINK_LOCKS")
 
-			cpv = 'sys-apps/portage-2.1'
-			metadata = {
+		ebuild_body = textwrap.dedent("""
+			pkg_nofetch() { : ; }
+		""")
+
+		ebuilds = {
+			'sys-apps/portage-2.1': {
 				'EAPI'      : '2',
-				'INHERITED' : 'python eutils',
 				'IUSE'      : 'build doc epydoc python3 selinux',
 				'KEYWORDS'  : 'x86',
 				'LICENSE'   : 'GPL-2',
-				'PROVIDE'   : 'virtual/portage',
 				'RDEPEND'   : '>=app-shells/bash-3.2_p17 >=dev-lang/python-2.6',
 				'SLOT'      : '0',
-				'repository': 'gentoo',
+				"MISC_CONTENT": ebuild_body,
 			}
+		}
+
+		playground = ResolverPlayground(ebuilds=ebuilds)
+		try:
 			root_config = playground.trees[playground.eroot]['root_config']
+			portdb = root_config.trees["porttree"].dbapi
+			settings = config(clone=playground.settings)
+			if "__PORTAGE_TEST_HARDLINK_LOCKS" in os.environ:
+				settings["__PORTAGE_TEST_HARDLINK_LOCKS"] = \
+					os.environ["__PORTAGE_TEST_HARDLINK_LOCKS"]
+				settings.backup_changes("__PORTAGE_TEST_HARDLINK_LOCKS")
+
+			cpv = 'sys-apps/portage-2.1'
+			metadata = dict(zip(Package.metadata_keys,
+				portdb.aux_get(cpv, Package.metadata_keys)))
+
 			pkg = Package(built=False, cpv=cpv, installed=False,
 				metadata=metadata, root_config=root_config,
 				type_name='ebuild')
@@ -86,5 +99,7 @@ class DoebuildSpawnTestCase(TestCase):
 			ebuild_phase.start()
 			ebuild_phase.wait()
 			self.assertEqual(ebuild_phase.returncode, os.EX_OK)
+
+			spawn_nofetch(portdb, portdb.findname(cpv), settings=settings)
 		finally:
 			playground.cleanup()


             reply	other threads:[~2013-01-11  7:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11  7:22 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-01-17  2:55 [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/ Zac Medico
2013-07-25 20:42 Zac Medico
2013-07-07 20:25 Zac Medico
2013-07-07 20:23 Zac Medico
2013-07-07  2:48 Zac Medico
2012-10-08 16:09 Zac Medico
2012-10-08 15:09 Zac Medico
2012-10-05  4:08 Zac Medico
2012-09-26 18:22 Zac Medico
2012-07-05  0:38 Zac Medico
2012-02-09  0:46 Zac Medico
2012-01-13  2:46 Zac Medico
2011-12-16  3:23 Zac Medico
2011-10-25 16:41 Zac Medico
2011-10-04  6:18 Zac Medico
2011-09-15  2:55 Zac Medico
2011-09-04 19:06 Zac Medico
2011-06-09 10:59 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1357888923.b5ef3cd3ef9261981f7f1dcadcdcf3f2a56d38f2.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox