Beispiel #1
0
 def testWPRunInteger(self):
     ''' As above just for integer types '''
     entries2test = [['pump1', '<td align="right">Pumpe 1:'],
                     ['pump2', '<td align="right">Pumpe 2:'],
                     ['heater', '<td align="right">Heizung:'],
                    ]
     for dict_key, line2grep in entries2test:
         for value in range(0, 2):   # test 0 and 1
             cook.status[dict_key] = value
             rv = self.app.get('/')
             line = helper.grepline(rv.data, line2grep)
             # print line, value
             assert str(value) in line
 def testWPRunInteger(self):
     ''' As above just for integer types '''
     entries2test = [
         ['pump1', '<td align="right">Pumpe 1:'],
         ['pump2', '<td align="right">Pumpe 2:'],
         ['heater', '<td align="right">Heizung:'],
     ]
     for dict_key, line2grep in entries2test:
         for value in range(0, 2):  # test 0 and 1
             cook.status[dict_key] = value
             rv = self.app.get('/')
             line = helper.grepline(rv.data, line2grep)
             # print line, value
             assert str(value) in line
Beispiel #3
0
 def testWPRunString(self):
     ''' As above just for string types '''
     entries2test = [['dlt_state', '<td align="right">DataLogger State:'],
                     ['pct_state', '<td align="right">ProcControl State:'],
                     ['wqt_state', '<td align="right">WorkQueue State:'],
                     ['tmt_state', '<td align="right">TempMon State:'],
                     ['cook_state', '<td align="right">Cook State:'],
                    ]
     strings2test = ['a', 'aa', 'Hallo', 'a very long string with spaces']
     for dict_key, line2grep in entries2test:
         for value in strings2test:
             cook.status[dict_key] = value
             rv = self.app.get('/')
             line = helper.grepline(rv.data, line2grep)
             # print line, value
             assert str(value) in line
 def testWPRunString(self):
     ''' As above just for string types '''
     entries2test = [
         ['dlt_state', '<td align="right">DataLogger State:'],
         ['pct_state', '<td align="right">ProcControl State:'],
         ['wqt_state', '<td align="right">WorkQueue State:'],
         ['tmt_state', '<td align="right">TempMon State:'],
         ['cook_state', '<td align="right">Cook State:'],
     ]
     strings2test = ['a', 'aa', 'Hallo', 'a very long string with spaces']
     for dict_key, line2grep in entries2test:
         for value in strings2test:
             cook.status[dict_key] = value
             rv = self.app.get('/')
             line = helper.grepline(rv.data, line2grep)
             # print line, value
             assert str(value) in line
Beispiel #5
0
    def testWPRunFloat(self):
        ''' Renders the run webpage with given float status values and checks
            the correct rendering (one decimal place) of these values.
        '''

        ''' entires2test contains all 
            dict_key, line2grep
            pairs that should be tested
        '''
        entries2test = [['tempk1', '<td align="right">Temp K1:'],
                        ['tempk2', '<td align="right">Temp K2:'],
                        ['settempk1', '<td align="right">Set Temp K1:'],
                        ['settempk2', '<td align="right">Set Temp K2:'],
                        ['setdurak1', '<td align="right">Set Dura K1:'],
                        ['setdurak2', '<td align="right">Set Dura K2:'],
                       ]
        for dict_key, line2grep in entries2test:
            for value in range(-101, 150, 10):
                fvalue = value * 1.0    # convert to float
                cook.status[dict_key] = fvalue
                rv = self.app.get('/')
                line = helper.grepline(rv.data, line2grep)
                # print line, fvalue
                assert str(fvalue) in line
 def testWPRunFloat(self):
     ''' Renders the run webpage with given float status values and checks
         the correct rendering (one decimal place) of these values.
     '''
     ''' entires2test contains all 
         dict_key, line2grep
         pairs that should be tested
     '''
     entries2test = [
         ['tempk1', '<td align="right">Temp K1:'],
         ['tempk2', '<td align="right">Temp K2:'],
         ['settempk1', '<td align="right">Set Temp K1:'],
         ['settempk2', '<td align="right">Set Temp K2:'],
         ['setdurak1', '<td align="right">Set Dura K1:'],
         ['setdurak2', '<td align="right">Set Dura K2:'],
     ]
     for dict_key, line2grep in entries2test:
         for value in range(-101, 150, 10):
             fvalue = value * 1.0  # convert to float
             cook.status[dict_key] = fvalue
             rv = self.app.get('/')
             line = helper.grepline(rv.data, line2grep)
             # print line, fvalue
             assert str(fvalue) in line