예제 #1
0
    def addInstance(self):
        self.updateStatus("Add instance")
        self.addedinstances += 1
        newinstancename = "new Instance %d"%self.addedinstances
        newinstance = IPETValue(newinstancename)

        self.browser.addNewElementAsChildOfSelectedElement(newinstance)
예제 #2
0
 def setUp(self):
     self.ex = HelpExperiment()
     ev = IPETEvaluation(defaultgroup="C1", 
                         index="A C"
                         )
     
     ev.addColumn(IPETEvaluationColumn(origcolname="D"))
     fg = IPETFilterGroup("Test")
     fi = IPETFilter(operator="keep", datakey="A")
     fi.addChild(IPETValue("A1"))
     fg.addFilter(fi)
     fg2 = IPETFilterGroup("Test2")
     fi2 = IPETFilter(operator="keep", datakey="A")
     fi2.addChild(IPETValue("A2"))
     fg2.addFilter(fi2)
     ev.addFilterGroup(fg2)
     ev.addFilterGroup(fg)
     self.ev = ev
     self.fg = fg
예제 #3
0
    def setUp(self):
        """
        create an evaluation around a helper experiment
        """
        self.ex = HelpExperiment()
        ev = IPETEvaluation(defaultgroup="C1",
                            index="A B C",
                            fillin=True,
                            indexsplit=3)

        ev.addColumn(
            IPETEvaluationColumn(origcolname="D", alternative="100",
                                 maxval=15))
        fg = IPETFilterGroup("Test")
        fi = IPETFilter(operator="keep", datakey="A")
        fi.addChild(IPETValue("A1"))
        fg.addFilter(fi)
        ev.addFilterGroup(fg)
        self.ev = ev
        self.fg = fg
예제 #4
0
 def enableOrDisableActions(self):
     for action, addclass in zip([self.addcolaction, self.addfiltergroupaction, self.addfilteraction, self.addaggregationaction, self.addinstancenaction],
                                 [IPETEvaluationColumn(), IPETFilterGroup(), IPETFilter(), Aggregation(), IPETValue()]):
         if self.browser.treewidget.currentItemAcceptsClassAsChild(addclass):
             action.setEnabled(True)
         else:
             action.setEnabled(False)
예제 #5
0
    def testValueLists(self):

        valuelist1 = [[IPETValue("A"),
                       IPETValue("B"),
                       IPETValue("C")],
                      [IPETValue("A"),
                       IPETValue("B"),
                       IPETValue("C")], [
                           IPETValue("A"),
                       ]]
        valuelist2 = [[IPETValue("A"),
                       IPETValue("B"),
                       IPETValue("C")],
                      [IPETValue("A"),
                       IPETValue("B"),
                       IPETValue("C")],
                      [IPETValue("A"),
                       IPETValue("B"),
                       IPETValue("C")]]

        operators1 = IPETFilter.valueoperators + IPETFilter.valueoperators[:1]
        operator2 = "keep"

        for op, v1list, v2list in zip(operators1, valuelist1, valuelist2):
            f1 = IPETFilter(datakey="ABC", operator=op)
            f2 = IPETFilter(datakey="ABC", operator=operator2)

            for v1 in v1list:
                f1.addChild(v1)
            for v2 in v2list:
                f2.addChild(v2)

            eq = f1.equals(f2)
            shouldbeequal = (op == operator2) and len(v1list) == len(v2list)

            self.assertEqual(eq, shouldbeequal, self.assertionMessage(f1, f2))