From: Zac Medico Date: Tue, 31 Aug 2010 05:00:44 +0000 (-0700) Subject: Add testcase to check that features_set._prune_overrides() is working X-Git-Tag: v2.2_rc73~22 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4adfd4490bc9c683a966afa386ac96a83b1d96aa;p=portage.git Add testcase to check that features_set._prune_overrides() is working correctly. --- 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()