Ejemplo n.º 1
0
    def testTrimmedAliasId(self):
        alias = RRDDataPointAlias(' alias1')
        self.assert_(alias.id == 'alias1')
        alias = RRDDataPointAlias('alias1 ')
        self.assert_(alias.id == 'alias1')
        alias = RRDDataPointAlias(' alias1 ')
        self.assert_(alias.id == 'alias1')

        t = createTemplate(self.dmd)
        ds0 = t.datasources()[0]
        dp0 = ds0.datapoints()[0]
        alias1 = manage_addDataPointAlias(dp0, ' alias1', '')
        self.assert_(alias1.id == 'alias1')
        alias2 = manage_addDataPointAlias(dp0, 'alias2 ', '')
        self.assert_(alias2.id == 'alias2')
        alias3 = manage_addDataPointAlias(dp0, ' alias3 ', '')
        self.assert_(alias3.id == 'alias3')
Ejemplo n.º 2
0
    def testTrimmedAliasId(self):
        alias = RRDDataPointAlias(' alias1')
        self.assert_(alias.id == 'alias1')
        alias = RRDDataPointAlias('alias1 ')
        self.assert_(alias.id == 'alias1')
        alias = RRDDataPointAlias(' alias1 ')
        self.assert_(alias.id == 'alias1')

        t = createTemplate(self.dmd)
        ds0 = t.datasources()[0]
        dp0 = ds0.datapoints()[0]
        alias1 = manage_addDataPointAlias(dp0, ' alias1', '')
        self.assert_(alias1.id == 'alias1')
        alias2 = manage_addDataPointAlias(dp0, 'alias2 ', '')
        self.assert_(alias2.id == 'alias2')
        alias3 = manage_addDataPointAlias(dp0, ' alias3 ', '')
        self.assert_(alias3.id == 'alias3')
Ejemplo n.º 3
0
 def manage_addDataPointAlias(self, id, formula, REQUEST=None ):
     """
     Add an alias to this datapoint
     """
     alias = manage_addDataPointAlias( self, id, formula )
     if REQUEST:
         return self.callZenScreen(REQUEST)
     return alias
Ejemplo n.º 4
0
 def manage_addDataPointAlias(self, id, formula, REQUEST=None):
     """
     Add an alias to this datapoint
     """
     alias = manage_addDataPointAlias(self, id, formula)
     if REQUEST:
         return self.callZenScreen(REQUEST)
     return alias
Ejemplo n.º 5
0
 def testCreateByMethod(self):
     aliasName = 'testalias3'
     aliasFormula = 'testformula2'
     t = createTemplate(self.dmd)
     ds0 = t.datasources()[0]
     dp0 = ds0.datapoints()[0]
     alias = manage_addDataPointAlias(dp0, aliasName, aliasFormula)
     self.assert_(alias.id == aliasName)
     self.assert_(alias.formula == aliasFormula)
Ejemplo n.º 6
0
 def testCreateByMethod(self):
     aliasName = 'testalias3'
     aliasFormula = 'testformula2'
     t = createTemplate(self.dmd)
     ds0 = t.datasources()[0]
     dp0 = ds0.datapoints()[0]
     alias = manage_addDataPointAlias(dp0, aliasName, aliasFormula)
     self.assert_(alias.id == aliasName)
     self.assert_(alias.formula == aliasFormula)
Ejemplo n.º 7
0
 def addAlias(self, id, formula=None):
     """
     Add a new alias to this datapoint
     """
     manage_addDataPointAlias( self, id, formula )
Ejemplo n.º 8
0
 def addAlias(self, id, formula=None):
     """
     Add a new alias to this datapoint
     """
     manage_addDataPointAlias(self, id, formula)