From 4adfd4490bc9c683a966afa386ac96a83b1d96aa Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 30 Aug 2010 22:00:44 -0700 Subject: Add testcase to check that features_set._prune_overrides() is working correctly. --- pym/portage/tests/ebuild/test_config.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'pym') diff --git a/pym/portage/tests/ebuild/test_config.py b/pym/portage/tests/ebuild/test_config.py index f48717d4f..b12605aac 100644 --- a/pym/portage/tests/ebuild/test_config.py +++ b/pym/portage/tests/ebuild/test_config.py @@ -13,7 +13,8 @@ class ConfigTestCase(TestCase): def testFeaturesMutation(self): """ Test whether mutation of config.features updates the FEATURES - variable and persists through config.regenerate() calls. + variable and persists through config.regenerate() calls. Also + verify that features_set._prune_overrides() works correctly. """ playground = ResolverPlayground() try: @@ -33,6 +34,12 @@ class ConfigTestCase(TestCase): self.assertEqual('noclean' in settings['FEATURES'].split(), True) settings.regenerate() self.assertEqual('noclean' in settings['FEATURES'].split(),True) + + # before: ['noclean', '-noclean', 'noclean'] + settings.features._prune_overrides() + # after: ['noclean'] + self.assertEqual(settings._features_overrides.count('noclean'), 1) + self.assertEqual(settings._features_overrides.count('-noclean'), 0) finally: playground.cleanup() -- cgit v1.2.3-1-g7c22