public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/dbapi/, pym/portage/tests/emerge/, pym/portage/tests/update/, ...
@ 2013-07-13  0:40 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; only message in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-13  0:40 UTC (permalink / raw
  To: gentoo-commits

commit:     720144837004a9b2ac9e4352f62c1bb388524105
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sat Jul 13 00:39:15 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sat Jul 13 00:39:15 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=72014483

Stop using config["PORTDIR"] in some tests.

---
 pym/portage/tests/dbapi/test_portdb_cache.py     |  6 +++---
 pym/portage/tests/emerge/test_emerge_slot_abi.py |  3 +--
 pym/portage/tests/emerge/test_simple.py          |  8 ++++----
 pym/portage/tests/repoman/test_simple.py         | 24 ++++++++++++------------
 pym/portage/tests/update/test_move_ent.py        |  6 +++---
 pym/portage/tests/update/test_move_slot_ent.py   |  6 +++---
 pym/portage/tests/update/test_update_dbentry.py  |  6 +++---
 7 files changed, 29 insertions(+), 30 deletions(-)

diff --git a/pym/portage/tests/dbapi/test_portdb_cache.py b/pym/portage/tests/dbapi/test_portdb_cache.py
index b9f9fed..e5270c5 100644
--- a/pym/portage/tests/dbapi/test_portdb_cache.py
+++ b/pym/portage/tests/dbapi/test_portdb_cache.py
@@ -1,4 +1,4 @@
-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import subprocess
@@ -29,9 +29,9 @@ class PortdbCacheTestCase(TestCase):
 		playground = ResolverPlayground(ebuilds=ebuilds, debug=debug)
 		settings = playground.settings
 		eprefix = settings["EPREFIX"]
-		portdir = settings["PORTDIR"]
+		test_repo_location = settings.repositories["test_repo"].location
 		user_config_dir = os.path.join(eprefix, USER_CONFIG_PATH)
-		metadata_dir = os.path.join(portdir, "metadata")
+		metadata_dir = os.path.join(test_repo_location, "metadata")
 		md5_cache_dir = os.path.join(metadata_dir, "md5-cache")
 		pms_cache_dir = os.path.join(metadata_dir, "cache")
 		layout_conf_path = os.path.join(metadata_dir, "layout.conf")

diff --git a/pym/portage/tests/emerge/test_emerge_slot_abi.py b/pym/portage/tests/emerge/test_emerge_slot_abi.py
index 401c23b..949caf3 100644
--- a/pym/portage/tests/emerge/test_emerge_slot_abi.py
+++ b/pym/portage/tests/emerge/test_emerge_slot_abi.py
@@ -1,4 +1,4 @@
-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import subprocess
@@ -64,7 +64,6 @@ class SlotAbiEmergeTestCase(TestCase):
 		trees = playground.trees
 		portdb = trees[eroot]["porttree"].dbapi
 		vardb = trees[eroot]["vartree"].dbapi
-		portdir = settings["PORTDIR"]
 		var_cache_edb = os.path.join(eprefix, "var", "cache", "edb")
 		user_config_dir = os.path.join(eprefix, USER_CONFIG_PATH)
 		package_mask_path = os.path.join(user_config_dir, "package.mask")

diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py
index bbff6d8..a74e646 100644
--- a/pym/portage/tests/emerge/test_simple.py
+++ b/pym/portage/tests/emerge/test_simple.py
@@ -168,10 +168,10 @@ pkg_preinst() {
 		eroot = settings["EROOT"]
 		trees = playground.trees
 		portdb = trees[eroot]["porttree"].dbapi
-		portdir = settings["PORTDIR"]
+		test_repo_location = settings.repositories["test_repo"].location
 		var_cache_edb = os.path.join(eprefix, "var", "cache", "edb")
 		cachedir = os.path.join(var_cache_edb, "dep")
-		cachedir_pregen = os.path.join(portdir, "metadata", "md5-cache")
+		cachedir_pregen = os.path.join(test_repo_location, "metadata", "md5-cache")
 
 		portage_python = portage._python_interpreter
 		dispatch_conf_cmd = (portage_python, "-Wd",
@@ -346,7 +346,7 @@ pkg_preinst() {
 			env["__PORTAGE_TEST_HARDLINK_LOCKS"] = \
 				os.environ["__PORTAGE_TEST_HARDLINK_LOCKS"]
 
-		updates_dir = os.path.join(portdir, "profiles", "updates")
+		updates_dir = os.path.join(test_repo_location, "profiles", "updates")
 		dirs = [cachedir, cachedir_pregen, distdir, fake_bin,
 			portage_tmpdir, updates_dir,
 			user_config_dir, var_cache_edb]
@@ -372,7 +372,7 @@ pkg_preinst() {
 			with open(os.path.join(profile_path, "packages"), 'w') as f:
 				f.write("*dev-libs/token-system-pkg")
 			for cp, xml_data in metadata_xml_files:
-				with open(os.path.join(portdir, cp, "metadata.xml"), 'w') as f:
+				with open(os.path.join(test_repo_location, cp, "metadata.xml"), 'w') as f:
 					f.write(playground.metadata_xml_template % xml_data)
 			with open(os.path.join(updates_dir, "1Q-2010"), 'w') as f:
 				f.write("""

diff --git a/pym/portage/tests/repoman/test_simple.py b/pym/portage/tests/repoman/test_simple.py
index 420297c..83227a9 100644
--- a/pym/portage/tests/repoman/test_simple.py
+++ b/pym/portage/tests/repoman/test_simple.py
@@ -1,4 +1,4 @@
-# Copyright 2011 Gentoo Foundation
+# Copyright 2011-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import subprocess
@@ -166,9 +166,9 @@ class SimpleRepomanTestCase(TestCase):
 		portdb = playground.trees[playground.eroot]["porttree"].dbapi
 		homedir = os.path.join(eroot, "home")
 		distdir = os.path.join(eprefix, "distdir")
-		portdir = settings["PORTDIR"]
-		profiles_dir = os.path.join(portdir, "profiles")
-		license_dir = os.path.join(portdir, "licenses")
+		test_repo_location = settings.repositories["test_repo"].location
+		profiles_dir = os.path.join(test_repo_location, "profiles")
+		license_dir = os.path.join(test_repo_location, "licenses")
 
 		repoman_cmd = (portage._python_interpreter, "-Wd",
 			os.path.join(PORTAGE_BIN_PATH, "repoman"))
@@ -228,7 +228,7 @@ class SimpleRepomanTestCase(TestCase):
 			"PATH" : os.environ["PATH"],
 			"PORTAGE_GRPNAME" : os.environ["PORTAGE_GRPNAME"],
 			"PORTAGE_USERNAME" : os.environ["PORTAGE_USERNAME"],
-			"PORTDIR" : portdir,
+			"PORTDIR" : test_repo_location,
 			"PYTHONPATH" : pythonpath,
 		}
 
@@ -240,7 +240,7 @@ class SimpleRepomanTestCase(TestCase):
 		try:
 			for d in dirs:
 				ensure_dirs(d)
-			with open(os.path.join(portdir, "skel.ChangeLog"), 'w') as f:
+			with open(os.path.join(test_repo_location, "skel.ChangeLog"), 'w') as f:
 				f.write(copyright_header)
 			with open(os.path.join(profiles_dir, "profiles.desc"), 'w') as f:
 				for x in profiles:
@@ -266,12 +266,12 @@ class SimpleRepomanTestCase(TestCase):
 				for k, v in use_desc:
 					f.write("%s - %s\n" % (k, v))
 			for cp, xml_data in metadata_xml_files:
-				with open(os.path.join(portdir, cp, "metadata.xml"), 'w') as f:
+				with open(os.path.join(test_repo_location, cp, "metadata.xml"), 'w') as f:
 					f.write(playground.metadata_xml_template % xml_data)
-			# Use a symlink to portdir, in order to trigger bugs
+			# Use a symlink to test_repo, in order to trigger bugs
 			# involving canonical vs. non-canonical paths.
-			portdir_symlink = os.path.join(eroot, "portdir_symlink")
-			os.symlink(portdir, portdir_symlink)
+			test_repo_symlink = os.path.join(eroot, "test_repo_symlink")
+			os.symlink(test_repo_location, test_repo_symlink)
 			# repoman checks metadata.dtd for recent CTIME, so copy the file in
 			# order to ensure that the CTIME is current
 			shutil.copyfile(metadata_dtd, os.path.join(distdir, "metadata.dtd"))
@@ -286,7 +286,7 @@ class SimpleRepomanTestCase(TestCase):
 				stdout = subprocess.PIPE
 
 			for cwd in ("", "dev-libs", "dev-libs/A", "dev-libs/B"):
-				abs_cwd = os.path.join(portdir_symlink, cwd)
+				abs_cwd = os.path.join(test_repo_symlink, cwd)
 				proc = subprocess.Popen([portage._python_interpreter, "-Wd",
 					os.path.join(PORTAGE_BIN_PATH, "repoman"), "full"],
 					cwd=abs_cwd, env=env, stdout=stdout)
@@ -306,7 +306,7 @@ class SimpleRepomanTestCase(TestCase):
 
 			if git_binary is not None:
 				for cwd, cmd in git_test:
-					abs_cwd = os.path.join(portdir_symlink, cwd)
+					abs_cwd = os.path.join(test_repo_symlink, cwd)
 					proc = subprocess.Popen(cmd,
 						cwd=abs_cwd, env=env, stdout=stdout)
 

diff --git a/pym/portage/tests/update/test_move_ent.py b/pym/portage/tests/update/test_move_ent.py
index 2504dee..d9647a9 100644
--- a/pym/portage/tests/update/test_move_ent.py
+++ b/pym/portage/tests/update/test_move_ent.py
@@ -1,4 +1,4 @@
-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import textwrap
@@ -59,12 +59,12 @@ class MoveEntTestCase(TestCase):
 		settings = playground.settings
 		trees = playground.trees
 		eroot = settings["EROOT"]
-		portdir = settings["PORTDIR"]
+		test_repo_location = settings.repositories["test_repo"].location
 		portdb = trees[eroot]["porttree"].dbapi
 		vardb = trees[eroot]["vartree"].dbapi
 		bindb = trees[eroot]["bintree"].dbapi
 
-		updates_dir = os.path.join(portdir, "profiles", "updates")
+		updates_dir = os.path.join(test_repo_location, "profiles", "updates")
 
 		try:
 			ensure_dirs(updates_dir)

diff --git a/pym/portage/tests/update/test_move_slot_ent.py b/pym/portage/tests/update/test_move_slot_ent.py
index fcb0cc6..3e49e11 100644
--- a/pym/portage/tests/update/test_move_slot_ent.py
+++ b/pym/portage/tests/update/test_move_slot_ent.py
@@ -1,4 +1,4 @@
-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import textwrap
@@ -94,12 +94,12 @@ class MoveSlotEntTestCase(TestCase):
 		settings = playground.settings
 		trees = playground.trees
 		eroot = settings["EROOT"]
-		portdir = settings["PORTDIR"]
+		test_repo_location = settings.repositories["test_repo"].location
 		portdb = trees[eroot]["porttree"].dbapi
 		vardb = trees[eroot]["vartree"].dbapi
 		bindb = trees[eroot]["bintree"].dbapi
 
-		updates_dir = os.path.join(portdir, "profiles", "updates")
+		updates_dir = os.path.join(test_repo_location, "profiles", "updates")
 
 		try:
 			ensure_dirs(updates_dir)

diff --git a/pym/portage/tests/update/test_update_dbentry.py b/pym/portage/tests/update/test_update_dbentry.py
index 39b8e66..8895114 100644
--- a/pym/portage/tests/update/test_update_dbentry.py
+++ b/pym/portage/tests/update/test_update_dbentry.py
@@ -1,4 +1,4 @@
-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import re
@@ -189,14 +189,14 @@ class UpdateDbentryTestCase(TestCase):
 		settings = playground.settings
 		trees = playground.trees
 		eroot = settings["EROOT"]
-		portdir = settings["PORTDIR"]
+		test_repo_location = settings.repositories["test_repo"].location
 		portdb = trees[eroot]["porttree"].dbapi
 		vardb = trees[eroot]["vartree"].dbapi
 		bindb = trees[eroot]["bintree"].dbapi
 		setconfig = trees[eroot]["root_config"].setconfig
 		selected_set = setconfig.getSets()["selected"]
 
-		updates_dir = os.path.join(portdir, "profiles", "updates")
+		updates_dir = os.path.join(test_repo_location, "profiles", "updates")
 
 		try:
 			ensure_dirs(updates_dir)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-13  0:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-13  0:40 [gentoo-commits] proj/portage:master commit in: pym/portage/tests/dbapi/, pym/portage/tests/emerge/, pym/portage/tests/update/, Arfrever Frehtes Taifersar Arahesis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox