def test_combine_two_feature(self): self.assertItemsEqual( ['foo', 'foo:bar', 'bar', 'bar:foo'], combine_features(['foo', 'bar']))
def declare_extras_features(context): LOG.debug('declaring extras for {0}'.format(context.info)) package_name = find_package_by_module(context.package) extras = find_extras_by_package(package_name) LOG.debug('extras for {}: {}'.format(package_name, extras)) installed_extras = [name for (name, dependencies) in extras.items() if all_packages_installed(dependencies)] for postfix in combine_features(installed_extras): feature_name = '{}:{}'.format(package_name, postfix) LOG.debug('declaring feature {}'.format(feature_name)) context.provideFeature(feature_name)
def test_combine_three_feature(self): self.assertItemsEqual( ['one', 'one:two', 'one:two:three', 'one:three', 'one:three:two', 'two', 'two:one', 'two:one:three', 'two:three', 'two:three:one', 'three', 'three:one', 'three:one:two', 'three:two', 'three:two:one'], combine_features(['one', 'two', 'three']))
def test_combine_one_feature(self): self.assertEquals( ['foo'], combine_features(['foo']))
def test_combine_zero_features(self): self.assertEquals([], combine_features([]))