Exemple #1
0
 def test_filter_omitted_all_some_modules(self):
     self.assertEqual(
         ["a", "b"],
         list(
             ModuleListHelper.filter_omitted(
                 modules=["a", "b"],
                 filter_config=AllDependencyFilterConfiguration())))
Exemple #2
0
 def test_filter_omitted_null_no_modules(self):
     self.assertEqual(
         [],
         list(
             ModuleListHelper.filter_omitted(
                 modules=[],
                 filter_config=NullDependencyFilterConfiguration())))
Exemple #3
0
 def test_no_focus_on(self):
     testee = EPMDependencyFilterConfigurationInternal(
         focus_on=None,
         module_grouper_class=NullModuleGrouper,
         physical_module_describer=CSharpPhysicalModuleDescriber(),
         modules=("A.Test", ))
     self.assertTrue(testee.skip_module_as_source("A.Test"))
     self.assertEquals(["A.Test"],
                       sorted(
                           ModuleListHelper.filter_omitted(
                               ["A.Test", "A.Impl"], testee)))
Exemple #4
0
 def test_integration_get_omitted_modules(self):
     self.assertEquals(
         ["A.Test.Mine"],
         sorted(
             ModuleListHelper.get_omitted_modules(
                 DefaultModuleListSupply(["A.Test.Mine", "B.Impl"]),
                 lambda modules: EPMDependencyFilterConfigurationInternal(
                     focus_on=None,
                     module_grouper_class=NullModuleGrouper,
                     physical_module_describer=
                     CSharpPhysicalModuleDescriber(),
                     modules=modules))))
Exemple #5
0
 def get_omitted_modules_by_type(physical_module_describer,
                                 module_list_supply,
                                 dependency_filter_config_class):
     assert isinstance_or_duck(physical_module_describer,
                               PhysicalModuleDescriber)
     assert isinstance_or_duck(module_list_supply, ModuleListSupply)
     key_func = lambda (module, size): tuple(
         PhysicalModuleTypes.names(
             physical_module_describer.get_physical_module_types(module)))
     grouped_modules = IterTools.sort_and_group(
         key_func,
         ModuleListHelper.get_omitted_modules_with_size(
             module_list_supply, dependency_filter_config_class))
     return ((x, tuple(y)) for (x, y) in grouped_modules)
Exemple #6
0
 def test_get_omitted_modules_with_size_some(self):
     self.assertEqual([("A", 0), ("B", 0)],
                      list(
                          ModuleListHelper.get_omitted_modules_with_size(
                              DefaultModuleListSupply(modules=["A", "B"]),
                              AllDependencyFilterConfiguration)))
 def _get_ungrouped_modules_list(self):
     # TODO Das ist eigentlich nicht EPM-spezifisch
     return ModuleListHelper.get_ungrouped_modules(
         module_list_supply=config_module_list_supply,
         module_grouper_class=config_module_grouper_class)