Exemple #1
0
 def test_merge(self):
     python = Python()
     python_specs = len(python.mapping_actual().keys())
     java = Java()
     java_specs = len(java.mapping_actual().keys())
     vanilla = Alias(refresh=False)
     vanilla_specs = len(vanilla.mapping_actual().keys())
     _merged = python.merge(java)
     self.assertEqual(python_specs, len(python.mapping_actual().keys()))
     self.assertEqual(java_specs, len(java.mapping_actual().keys()))
     _merged = vanilla.merge(java)
     '''MergeRules get this @ merging:'''
     del _merged.mapping_actual()["display available commands"]
     self.assertEqual(vanilla_specs + java_specs, len(_merged.mapping_actual().keys()))
     self.assertEqual(vanilla_specs, len(vanilla.mapping_actual().keys()))
Exemple #2
0
 def test_merge(self):
     python = Python()
     python_specs = len(python.mapping_actual().keys())
     java = Java()
     java_specs = len(java.mapping_actual().keys())
     vanilla = Alias(refresh=False)
     vanilla_specs = len(vanilla.mapping_actual().keys())
     _merged = python.merge(java)
     self.assertEqual(python_specs, len(python.mapping_actual().keys()))
     self.assertEqual(java_specs, len(java.mapping_actual().keys()))
     _merged = vanilla.merge(java)
     '''MergeRules get this @ merging:'''
     del _merged.mapping_actual()["display available commands"]
     self.assertEqual(vanilla_specs + java_specs,
                      len(_merged.mapping_actual().keys()))
     self.assertEqual(vanilla_specs, len(vanilla.mapping_actual().keys()))
Exemple #3
0
 def test_runtime_global_spec_replace(self):
     ff = make_filter(lambda mp: incoming_gets_priority(mp),
                      lambda mp: there_is_spec_overlap(mp), MergeInf.RUN,
                      MergeInf.GLOBAL)
     self.nexus.merger.add_filter(ff)
     python = Python()
     '''attempt to emerge in an identical rule with a filter that allows it:'''
     self.set_global(self._python2, True, True)
     self.assertTrue(self.nexus.merger._config[CCRMerger._GLOBAL]["Python"])
     self.assertTrue(self.nexus.merger._config[CCRMerger._GLOBAL][self._python2])
     '''this is minus one because of the "show available commands" command: '''
     merged_specs = len(self.nexus.merger._base_global.mapping_actual().keys()) - 1
     python_specs = len(python.mapping_actual().keys())
     self.assertEqual(merged_specs, python_specs)
     '''make sure were not deleting from the Python class mapping: '''
     self.assertNotEqual(python_specs, 0)
     '''clear filters, clean up'''
     self.nexus.merger._filters = []
     self.set_global(self._python2, False, True)