diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-10-29 16:29:37 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-10-29 16:29:37 -0700 |
commit | b97f47c481288f6c399af41cc33e0ad349842e8b (patch) | |
tree | c6cd0231492fb02f439c8eb03e7d11ee9514093e /pym/portage/tests/ebuild | |
parent | 142f30000454ac002334ebbecc3ad4010b64e796 (diff) | |
download | portage-b97f47c481288f6c399af41cc33e0ad349842e8b.tar.gz portage-b97f47c481288f6c399af41cc33e0ad349842e8b.tar.bz2 portage-b97f47c481288f6c399af41cc33e0ad349842e8b.zip |
Fix LazyItemsDict.__deepcopy__() for python 2.7.
In python-2.7, changes in deepcopy() make LazyItemsDict.__deepcopy__()
fail in some cases. Thanks to Diego E. Pettenò <flameeyes@g.o> for
reporting.
Diffstat (limited to 'pym/portage/tests/ebuild')
-rw-r--r-- | pym/portage/tests/ebuild/test_config.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pym/portage/tests/ebuild/test_config.py b/pym/portage/tests/ebuild/test_config.py index 5af8da5fb..764031707 100644 --- a/pym/portage/tests/ebuild/test_config.py +++ b/pym/portage/tests/ebuild/test_config.py @@ -10,6 +10,28 @@ from portage.tests.resolver.ResolverPlayground import ResolverPlayground, Resolv class ConfigTestCase(TestCase): + def testClone(self): + """ + Test the clone via constructor. + """ + + ebuilds = { + "dev-libs/A-1": { }, + } + + playground = ResolverPlayground(ebuilds=ebuilds) + try: + settings = config(clone=playground.settings) + result = playground.run(["=dev-libs/A-1"]) + pkg, existing_node = result.depgraph._select_package( + playground.root, "=dev-libs/A-1") + settings.setcpv(pkg) + + # clone after setcpv tests deepcopy of LazyItemsDict + settings2 = config(clone=settings) + finally: + playground.cleanup() + def testFeaturesMutation(self): """ Test whether mutation of config.features updates the FEATURES |