Example #1
0
    def test(self):

        t = MinMaxThreshold("test_threshold")
        t.minval = self.min
        t.maxval = self.max
        ti = None
        d = self._getDevice()
        if d:
            ti = t.createThresholdInstance(d)
            if self.min:
                print "Using min of %s which evaluates to %s" % (self.min, ti.minimum)
            if self.max:
                print "Using max of %s which evaluates to %s" % (self.max, ti.maximum)
           
            print "The following event would be generated: %s" % ti.checkRange("test_threshold", self.value)
 def afterSetUp(self):
     super(TestMinMaxThreshold, self).afterSetUp()
     device = self.dmd.Devices.createInstance('test-device')
     t = MinMaxThreshold('test')
     self.threshold = t.createThresholdInstance(device)