Ejemplo n.º 1
0
    def testEquality(self):
        """Test ConfigDictField.__eq__

        We create two configs, with the keys explicitly added in a different
        order and test their equality.
        """
        keys1 = ['A', 'B', 'C']
        keys2 = ['X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e']

        c1 = Config3()
        c1.field1 = {k: pexConfig.Config() for k in keys1}
        for k in keys2:
            c1.field1[k] = pexConfig.Config()

        c2 = Config3()
        for k in keys2 + keys1:
            c2.field1[k] = pexConfig.Config()

        self.assertTrue(pexConfig.compareConfigs('test', c1, c2))
Ejemplo n.º 2
0
    def testEquality(self):
        """Test ConfigDictField.__eq__

        We create two configs, with the keys explicitly added in a different
        order and test their equality.
        """
        keys1 = ["A", "B", "C"]
        keys2 = ["X", "Y", "Z", "a", "b", "c", "d", "e"]

        c1 = Config3()
        c1.field1 = {k: pexConfig.Config() for k in keys1}
        for k in keys2:
            c1.field1[k] = pexConfig.Config()

        c2 = Config3()
        for k in keys2 + keys1:
            c2.field1[k] = pexConfig.Config()

        self.assertTrue(pexConfig.compareConfigs("test", c1, c2))
Ejemplo n.º 3
0
 def testEmptyDatasetConfig(self):
     """Test for a config without datasets
     """
     config = pexConfig.Config()
     self.assertEqual(pipeBase.PipelineTask.getInputDatasetTypes(config),
                      {})
     self.assertEqual(pipeBase.PipelineTask.getOutputDatasetTypes(config),
                      {})
     self.assertEqual(
         pipeBase.PipelineTask.getInitInputDatasetTypes(config), {})
     self.assertEqual(
         pipeBase.PipelineTask.getInitOutputDatasetTypes(config), {})