public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/standard/
Date: Wed, 29 Jun 2011 12:58:07 +0000 (UTC)	[thread overview]
Message-ID: <6f30312d03eed2ac0317bbf0afab11b9f6d9313d.mgorny@gentoo> (raw)

commit:     6f30312d03eed2ac0317bbf0afab11b9f6d9313d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 29 12:25:54 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jun 29 12:25:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=6f30312d

Add a common DBusFetchingEbuildTestCase.

---
 pmstestsuite/library/standard/deprecated_vars.py  |   12 ++++++++----
 pmstestsuite/library/standard/ext_cases.py        |   19 +++++++++++++++++++
 pmstestsuite/library/standard/workdir_fallback.py |    7 +++----
 3 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/pmstestsuite/library/standard/deprecated_vars.py b/pmstestsuite/library/standard/deprecated_vars.py
index c4c72a3..fce66f9 100644
--- a/pmstestsuite/library/standard/deprecated_vars.py
+++ b/pmstestsuite/library/standard/deprecated_vars.py
@@ -3,15 +3,14 @@
 # Released under the terms of the 2-clause BSD license.
 
 from pmstestsuite.library.standard.dbus_case import DBusEbuildTestCase
+from pmstestsuite.library.standard.ext_cases import DBusFetchingEbuildTestCase
 
-class AATest(DBusEbuildTestCase):
+class AATest(DBusFetchingEbuildTestCase):
 	""" Test whether AA is declared. """
 
 	relevant_eapis = (3, 4)
 	ebuild_vars = {
-		'IUSE': 'pms_tests_magical_hidden_use', # XXX?
-		'SRC_URI': '''pms_tests_magical_hidden_use? (
-		http://www.gentoo.org/ -> pms-test-suite-dummy.html )'''
+		'IUSE': 'pms_tests_magical_hidden_use' # XXX?
 	}
 	phase_funcs = {
 		'src_unpack': [
@@ -19,6 +18,11 @@ class AATest(DBusEbuildTestCase):
 		]
 	}
 
+	def __init__(self, *args, **kwargs):
+		DBusFetchingEbuildTestCase.__init__(self, *args, **kwargs)
+		self.ebuild_vars['SRC_URI'] = 'pms_tests_magical_hidden_use? ( %s )' \
+				% self.ebuild_vars['SRC_URI']
+
 	def check_dbus_result(self, output, pm):
 		if self.eapi < 4:
 			expect = 'pms-test-suite-dummy.html'

diff --git a/pmstestsuite/library/standard/ext_cases.py b/pmstestsuite/library/standard/ext_cases.py
new file mode 100644
index 0000000..d1d5eb6
--- /dev/null
+++ b/pmstestsuite/library/standard/ext_cases.py
@@ -0,0 +1,19 @@
+#	vim:fileencoding=utf-8
+# (c) 2011 Michał Górny <mgorny@gentoo.org>
+# Released under the terms of the 2-clause BSD license.
+
+from pmstestsuite.library.standard.dbus_case import DBusEbuildTestCase
+
+class DBusFetchingEbuildTestCase(DBusEbuildTestCase):
+	"""
+	A DBusEbuildTestCase variant with a standarized way of fetching
+	sources -- to decrease ${DISTDIR} pollution.
+	"""
+
+	def __init__(self, *args, **kwargs):
+		DBusEbuildTestCase.__init__(self, *args, **kwargs)
+		# XXX: switch to a dedicated file without the arrow
+		val = 'http://www.gentoo.org/ -> pms-test-suite-dummy.html'
+		if 'SRC_URI' in self.ebuild_vars:
+			val = '%s %s' % (self.ebuild_vars['SRC_URI'], val)
+		self.ebuild_vars['SRC_URI'] = val

diff --git a/pmstestsuite/library/standard/workdir_fallback.py b/pmstestsuite/library/standard/workdir_fallback.py
index 142c33c..96cd2e8 100644
--- a/pmstestsuite/library/standard/workdir_fallback.py
+++ b/pmstestsuite/library/standard/workdir_fallback.py
@@ -2,9 +2,9 @@
 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-from pmstestsuite.library.standard.dbus_case import DBusEbuildTestCase
+from pmstestsuite.library.standard.ext_cases import DBusFetchingEbuildTestCase
 
-class WorkdirFallbackTest(DBusEbuildTestCase):
+class WorkdirFallbackTest(DBusFetchingEbuildTestCase):
 	""" S=${WORKDIR} fallback test. """
 
 	relevant_eapis = (2, 4)
@@ -15,7 +15,6 @@ class WorkdirFallbackTest(DBusEbuildTestCase):
 	# 3) have one of the further phase funcs.
 
 	ebuild_vars = {
-		'SRC_URI': 'http://www.gentoo.org/ -> pms-test-suite-dummy.html',
 		'S': '${WORKDIR}/nonexistent'
 	}
 	phase_funcs = {
@@ -28,5 +27,5 @@ class WorkdirFallbackTest(DBusEbuildTestCase):
 	}
 
 	def __init__(self, *args, **kwargs):
-		DBusEbuildTestCase.__init__(self, *args, **kwargs)
+		DBusFetchingEbuildTestCase.__init__(self, *args, **kwargs)
 		self.expect_failure = (self.eapi == 4)



             reply	other threads:[~2011-06-29 12:58 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-29 12:58 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-06-20  8:01 [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/standard/ Michał Górny
2012-01-03 17:50 Michał Górny
2012-01-03 17:50 Michał Górny
2012-01-03 15:52 Michał Górny
2011-08-13  8:54 Michał Górny
2011-08-12 20:55 Michał Górny
2011-08-08  2:56 Michał Górny
2011-08-07 14:57 Michał Górny
2011-08-07 14:57 Michał Górny
2011-08-07 14:48 Michał Górny
2011-08-06 14:25 Michał Górny
2011-08-06  8:31 Michał Górny
2011-08-06  8:31 Michał Górny
2011-08-05 21:36 Michał Górny
2011-08-05 21:36 Michał Górny
2011-08-05 21:36 Michał Górny
2011-08-05 21:36 Michał Górny
2011-08-05 10:04 Michał Górny
2011-08-05  8:54 Michał Górny
2011-08-03 20:17 Michał Górny
2011-08-03 20:17 Michał Górny
2011-08-03 17:10 Michał Górny
2011-08-03 17:10 Michał Górny
2011-08-03 17:10 Michał Górny
2011-08-03  8:17 Michał Górny
2011-08-02 18:53 Michał Górny
2011-08-02 18:53 Michał Górny
2011-07-28 17:15 Michał Górny
2011-07-27 16:50 Michał Górny
2011-07-27 16:50 Michał Górny
2011-07-27 16:50 Michał Górny
2011-07-26 17:34 Michał Górny
2011-07-24 14:37 Michał Górny
2011-07-24 14:37 Michał Górny
2011-07-18  6:32 Michał Górny
2011-07-18  6:32 Michał Górny
2011-06-29 17:52 Michał Górny
2011-06-28 16:15 Michał Górny
2011-06-28 16:15 Michał Górny
2011-06-25  8:39 Michał Górny
2011-06-24 18:03 [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/library/standard/ Michał Górny
2011-06-24 18:03 Michał Górny
2011-06-24 18:03 Michał Górny
2011-06-23 21:14 Michał Górny
2011-06-23 21:14 Michał Górny
2011-06-23  9:51 Michał Górny
2011-06-22 19:53 Michał Górny
2011-06-22 13:32 Michał Górny
2011-06-17 14:28 Michał Górny
2011-06-17 14:28 Michał Górny
2011-06-17 14:28 Michał Górny
2011-05-31 19:18 Michał Górny

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=6f30312d03eed2ac0317bbf0afab11b9f6d9313d.mgorny@gentoo \
    --to=mgorny@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