summaryrefslogtreecommitdiffstats
path: root/pym/portage/__init__.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-08-28 23:50:16 -0700
committerZac Medico <zmedico@gentoo.org>2011-08-28 23:50:16 -0700
commit0891a5f671527f99fa1e9ca56ea96e5566abd52f (patch)
tree10d8dfe2f9f585d9ec91d510049c21e1f39f4b96 /pym/portage/__init__.py
parent7e0ac7d2c92f3556623e4ff34bebffd80fe5f23a (diff)
downloadportage-0891a5f671527f99fa1e9ca56ea96e5566abd52f.tar.gz
portage-0891a5f671527f99fa1e9ca56ea96e5566abd52f.tar.bz2
portage-0891a5f671527f99fa1e9ca56ea96e5566abd52f.zip
emerge: add simple unit tests
These tests are similar to the repoman tests, using a __PORTAGE_TEST_EPREFIX environment variable to make emerge confine itself to a testing prefix so that things like install and uninstall operations can be performed.
Diffstat (limited to 'pym/portage/__init__.py')
-rw-r--r--pym/portage/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 78d9b5475..72cdf2dbb 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -472,8 +472,9 @@ def create_trees(config_root=None, target_root=None, trees=None):
portdbapi.portdbapi_instances.remove(portdb)
del trees[myroot]["porttree"], myroot, portdb
+ eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX")
settings = config(config_root=config_root, target_root=target_root,
- config_incrementals=portage.const.INCREMENTALS)
+ config_incrementals=portage.const.INCREMENTALS, _eprefix=eprefix)
settings.lock()
myroots = [(settings["ROOT"], settings)]
@@ -489,7 +490,8 @@ def create_trees(config_root=None, target_root=None, trees=None):
v = settings.get(k)
if v is not None:
clean_env[k] = v
- settings = config(config_root=None, target_root="/", env=clean_env)
+ settings = config(config_root=None, target_root="/",
+ env=clean_env, _eprefix=eprefix)
settings.lock()
myroots.append((settings["ROOT"], settings))