Exemplo n.º 1
0
 def __init__(self):
     DataLogServer.__init__(self, logTime=.5, database='mock')
     self.logged.connect(self.printEventLogged)
     self.time = 0
     self.testdata = None
Exemplo n.º 2
0
 def start(self, testdata=None):
     self.testdata = testdata
     DataLogServer.start(self)
Exemplo n.º 3
0
        self.assertTrue(self.serv.testdata['_id'] in self.serv.db, 'Data not stored to database')
        
        self.assertEqual(self.serv.testdata,self.serv.db[self.serv.testdata['_id']],'Missmatch between stored and mock data')
        
if __name__ == "__main__":
    import sys;sys.argv = ['',
                           'DataLogger.log01',
                           'DataLogger.logDict01',
                           'DataLogger.tellIgnore01',
                           'DataLogger.tellUnignore01',
                           'DataLogger.tellRemove01',
                           'DataLogger.getLastData01',
                           'DataLogger.tellSubscribe01',
                           'DataLogger.tellSubscribe02',
                           'DataLogger.tellUnsubscribe01',
                           'DataLogger.servSave01']
    
    from PyQt4 import QtCore
    from qao.io import messageBus

    try:
            mbcli = messageBus.MessageBusClient()
            mbcli.connectToServer('localhost')
            if(not mbcli.isConnected()):
                raise Exception('no connection to messageBus')
    except Exception as ex:
        print 'no connection to messageBus: ',ex
        sys.exit()
        
    DataLogServer.setup(database='mock')
    unittest.main()