Beispiel #1
0
 def setUp(self):
     self.obj = Base.ParentAwareXpath()
     self.obj.add_profile(value=self.DEFAULT_PATH_1)
     self.obj.add_profile("1.0.0", self.DEFAULT_PATH_2)
     self.obj.add_profile(value=self.SPECIFIED_PATH_1,
                          parents=("ParentClass1", "ParentClass2"))
     self.obj.add_profile("2.0.0", self.SPECIFIED_PATH_2,
                          ("ParentClass1", "ParentClass2"))
Beispiel #2
0
    def test_no_fallback_raises_value_error(self):
        parent = None
        obj = Base.ParentAwareXpath()
        obj.add_profile(
            parents=("ParentClass1", ),
            value="/some/path",
        )

        self.assertRaises(ValueError, obj._get_versioned_value, (1, 0, 0),
                          parent)
Beispiel #3
0
 def setUp(self):
     self.obj = Base.ParentAwareXpath()
     self.obj.add_profile(parents=("ParentClass1", None),
                          value=self.OLD_LAYER3_PATH)
     self.obj.add_profile(version="1.0.0",
                          parents=("ParentClass1", None),
                          value=self.NEW_LAYER3_PATH)
     self.obj.add_profile(
         parents=("ParentClass1", ),
         parent_param="mode",
         parent_param_values=["junk", "layer2"],
         value=self.OLD_LAYER2_PATH,
     )
     self.obj.add_profile(
         version="2.0.0",
         parents=("ParentClass1", ),
         parent_param="mode",
         parent_param_values=["junk", "layer2"],
         value=self.NEW_LAYER2_PATH,
     )